"Scott Baxter" <scott@xxxxxx> wrote in message
news:eNT0rt83JHA.1372@xxxxxx
> Hello,
>
> In VB 6 I could easily get to the document object of either internet
> explorer, or the web browser control, and get all the links, etc. through
> arrays.
>
> In VB.net I can't even seem to assign the document object to a variable
> (thedoc). So I can't get to any of the info I need.
>
> Is there something I'm missing?
>
> Here's the code I used, or attempted to use.
>
> Thanks.
>
> Scott
>
> Public IE As SHDocVw.InternetExplorer
> Dim ie As SHDocVw.InternetExplorer
> ie = New SHDocVw.InternetExplorer
> ie.Visible = True
> ie.Navigate("http://www.msn.com")
> Do While ie.Busy
> Application.DoEvents()
> Loop
> dim iestuff as string=""
> For ix As Integer = 0 To thedoc.Links.Count - 1
> iestuff = iestuff & thedoc.Links(ix).href & ControlChars.CrLf
> Next Try the below code and see if it does what you want. It's basically the
same thing you posted, just changed to VBScript syntax.
Set oIE = CreateObject("InternetExplorer.Application")
oIE.visible = True
oIE.navigate "http://www.msn.com"
Do While oIE.busy
WScript.Sleep 100
Loop
For Each sLink in oIE.document.links
sLinks = sLinks & sLink & vbCrLf
Next
MsgBox sLinks