Windows Vista Forums

automating ie or webbrowser control
  1. #1


    Scott Baxter Guest

    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

  2. #2


    James Whitlow Guest

    Re: automating ie or webbrowser control

    "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



      My System SpecsSystem Spec

  3. #3


    Cor Ligthert[MVP] Guest

    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

  4. #4


    Scott Baxter Guest

    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

    > 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

automating ie or webbrowser control problems?

Similar Threads
Thread Thread Starter Forum Replies Last Post
Alternative to WebBrowser control? ngrTerry .NET General 3 04 Nov 2009
How do I debug JavaScript in a WebBrowser control? John Brock .NET General 5 15 Sep 2009
Printint the content of a webbrowser control graphicsxp .NET General 1 15 Apr 2008
How to get a handle to WebBrowser Control's scrollbar? Polaris .NET General 0 12 Apr 2008
WebBrowser control in a WPF app. Shogun Avalon 3 04 May 2006