Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > VB Script

Vista - automating ie or webbrowser control

Reply
 
Old 05-28-2009   #1 (permalink)
Scott Baxter


 
 

automating ie or webbrowser control

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


My System SpecsSystem Spec
Old 05-28-2009   #2 (permalink)
James Whitlow


 
 

Re: automating ie or webbrowser control

"Scott Baxter" <scott@xxxxxx> wrote in message
news:eNT0rt83JHA.1372@xxxxxx
Quote:

> 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


My System SpecsSystem Spec
Old 05-29-2009   #3 (permalink)
Cor Ligthert[MVP]


 
 

Re: automating ie or webbrowser control

Scott,

Since version VB8 there is a special Net webbrowser (which uses ShDocVw as
well)

You are using the old Intereop one, in fact that one should work the same as
in VB6 an VB7 but it is possible that it is not exact like that.

Try to avoid that do events loop, that completely eats your processing.
As you want a stop use sleep, or better an even about the document complete.

By the way, your post is in all other newsgroups you posted too beside
languages.vb simply spam.

Cor

My System SpecsSystem Spec
Old 05-29-2009   #4 (permalink)
Scott Baxter


 
 

Re: automating ie or webbrowser control

Hello,

Thanks. I'll look for that Net Webbrowser.

I had made some posts without much answer, so I posted to the other groups
in hope of a response. Sorry for any inconvenience.

Scott
"Cor Ligthert[MVP]" <Notmyfirstname@xxxxxx> wrote in message
news:Ob85OTD4JHA.4872@xxxxxx
Quote:

> Scott,
>
> Since version VB8 there is a special Net webbrowser (which uses ShDocVw as
> well)
>
> You are using the old Intereop one, in fact that one should work the same
> as in VB6 an VB7 but it is possible that it is not exact like that.
>
> Try to avoid that do events loop, that completely eats your processing.
> As you want a stop use sleep, or better an even about the document
> complete.
>
> By the way, your post is in all other newsgroups you posted too beside
> languages.vb simply spam.
>
> Cor
My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
How do I debug JavaScript in a WebBrowser control? .NET General
How to copy text from webbrowser/Frame Control (WPF) .NET General
is the dotnet 2 webbrowser control based on IE 6 or 7? .NET General
Printint the content of a webbrowser control .NET General


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46