-
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
-
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
-
Re: HTMLDocument
Just exactly what is "w"?
-
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
-
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
-
Re: HTMLDocument
Nevermind, hehehe, typo.
it happens to everyone. (shrug)
John
John Pirkey
MCSD
www.ShallowWaterSystems.com