"Scott Baxter" <scott@xxxxxx> wrote in message
> 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
> 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.
> Public IE As SHDocVw.InternetExplorer
> Dim ie As SHDocVw.InternetExplorer
> ie = New SHDocVw.InternetExplorer
> ie.Visible = True
> Do While ie.Busy
> dim iestuff as string=""
> For ix As Integer = 0 To thedoc.Links.Count - 1
> iestuff = iestuff & thedoc.Links(ix).href & ControlChars.CrLf
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
Do While oIE.busy
For Each sLink in oIE.document.links
sLinks = sLinks & sLink & vbCrLf