Results 1 to 8 of 8

Thread: Parse <font .... </font> tag and view the progress into a Rich Text Box (Solved)

  1. #1

    Thread Starter
    Hyperactive Member DarkX_Greece's Avatar
    Join Date
    Jan 2004
    Location
    Athens (Greece)
    Posts
    315

    Exclamation Parse <font .... </font> tag and view the progress into a Rich Text Box (Solved)

    Hello, does anyone know how to parse the <font ... > </font> tag from an html file and view the output into a Rich Text Box? Using VB Code and even RTF code if you want.

    For example: i have this tag

    <font name="Arial" size="3" color="#FF0000>Hello</font>

    Hello
    Last edited by DarkX_Greece; Mar 26th, 2004 at 01:47 PM.
    Short CV:
    1. Visual Basic 6 Programmer
    2. Web Expert


    Botonakis Web Services

  2. #2
    PowerPoster RhinoBull's Avatar
    Join Date
    Mar 2004
    Location
    New Amsterdam
    Posts
    24,132
    Take a look at Microsoft XML x.x library parser.

  3. #3
    PowerPoster RhinoBull's Avatar
    Join Date
    Mar 2004
    Location
    New Amsterdam
    Posts
    24,132
    Here is a quick sample for you:
    VB Code:
    1. Private Sub Command1_Click()
    2. '===================================
    3. Dim xml As New MSXML2.DOMDocument30
    4. Dim nds As MSXML2.IXMLDOMNodeList
    5. Dim nd As MSXML2.IXMLDOMNode
    6. Dim bRes As Boolean
    7.  
    8.     bRes = xml.Load("c:\temp\test.htm")
    9.     Set nds = xml.selectNodes(LCase("//Font"))
    10.     Set nd = nds(0)
    11.     Debug.Print nd.Text
    12.     Set xml = Nothing
    13.     Set nds = Nothing
    14.     Set nd = Nothing
    15.  
    16. End Sub
    Last edited by RhinoBull; Mar 26th, 2004 at 11:58 AM.

  4. #4

    Thread Starter
    Hyperactive Member DarkX_Greece's Avatar
    Join Date
    Jan 2004
    Location
    Athens (Greece)
    Posts
    315
    Thanks rhino bull but i don't want to use external dll files. I use only vb code that doesn't uses other dlls or activex componets. Any ideas in simple vb code? I have already done a code that supports some of the features of the font tag but i want all the features. The code is in the attached text file. It is a little big to write it in this reply. Please view it and help me. I need it badly!



    Thanks
    Attached Files Attached Files
    Short CV:
    1. Visual Basic 6 Programmer
    2. Web Expert


    Botonakis Web Services

  5. #5
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687
    Originally posted by DarkX_Greece
    Thanks rhino bull but i don't want to use external dll files. I use only vb code that doesn't uses other dlls or activex componets.
    Well, now that is an amazing feat. How do you use the RichTextBox, w/o adding it to your project (I mean, it IS an external OCX as well.).....

    TG
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  6. #6

    Thread Starter
    Hyperactive Member DarkX_Greece's Avatar
    Join Date
    Jan 2004
    Location
    Athens (Greece)
    Posts
    315
    I mean that i use vb code only for parsing!!!!!!!! For anything else i use activex controls, not dlls!



    Now?
    Am i wrong?

    Thanks
    Short CV:
    1. Visual Basic 6 Programmer
    2. Web Expert


    Botonakis Web Services

  7. #7
    PowerPoster RhinoBull's Avatar
    Join Date
    Mar 2004
    Location
    New Amsterdam
    Posts
    24,132
    Originally posted by DarkX_Greece
    Thanks rhino bull but i don't want to use external dll files. I use only vb code that doesn't uses other dlls or activex componets. ...
    Thanks
    You're welcome.
    That library I've mentioned has become a Windows standard component since W98 (I might be off on dates), so you don't really have to distribute it and use late bindings instead (CreateObject function will take care of that). But what you're saying doesn't really make sense (especially in this case): html type files are not easy to parse so why would you refuse to use such powerfull library remains a mystery to me. I would understand if FSO was suggested instead of VB's intrinsic File I/O functionality ...

    Good luck in your development.

  8. #8

    Thread Starter
    Hyperactive Member DarkX_Greece's Avatar
    Join Date
    Jan 2004
    Location
    Athens (Greece)
    Posts
    315
    Thanks RhinoBull, i didn't know it! I am developing a web browser control. I started this project before 2 months and i already done all the tags except font tag. I will try your way and i will tell you.
    Short CV:
    1. Visual Basic 6 Programmer
    2. Web Expert


    Botonakis Web Services

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width