CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6

Thread: HTMLDocument

  1. #1
    Join Date
    Sep 1999
    Posts
    6

    HTMLDocument

    Hi,

    I wanted to do something really simple in VB using HTMLDocument. What I wanted to do was to retrieve the title of a URL. What would be the easiest way to do this using HTMLDocument. Example below:

    ...

    Set inet = New HTMLDocument

    inet.open "http://www.codeguru.com"

    Title.Text = inet.Title

    inet.Close ...


    I'm not sure about the third line, I have an edit box on my form called title, and I wanted to set the text to whatever the title of the URL was. If you can help me out, I'd really appreciate it.

    TIA, -Lito



  2. #2
    Join Date
    May 1999
    Posts
    3,332

    Re: HTMLDocument

    here is a working sample

    Dim h as new HTMLDocument
    w.navigate "http://yourURLGoesHere"
    set h = w.document
    MsgBox h.Title



    w is the name of a Web Browser control


  3. #3
    Join Date
    Sep 1999
    Posts
    6

    Re: HTMLDocument

    Just exactly what is "w"?


  4. #4
    Join Date
    May 1999
    Posts
    3,332

    Re: HTMLDocument

    did you really read my post?
    >w is the name of a Web Browser control

    That's what it is: the name of a Web Browser control that I placed on the form -> Project/components/Microsoft Internet Controls


  5. #5
    Join Date
    Jan 2000
    Location
    MO, USA
    Posts
    1,506

    Re: HTMLDocument

    Is there some other reference that I have to set for this code to work? I keep getting the lovely User-defined type not defined on the New HTMLDocument. I already have the Internet Controls checked in both the references and components. Any suggestions?

    Thanks,
    John

    John Pirkey
    MCSD
    www.ShallowWaterSystems.com
    John Pirkey
    MCSD (VB6)
    http://www.stlvbug.org

  6. #6
    Join Date
    Jan 2000
    Location
    MO, USA
    Posts
    1,506

    Re: HTMLDocument

    Nevermind, hehehe, typo.

    it happens to everyone. (shrug)

    John

    John Pirkey
    MCSD
    www.ShallowWaterSystems.com
    John Pirkey
    MCSD (VB6)
    http://www.stlvbug.org

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

Featured