Results 1 to 12 of 12

Thread: When page is done loading

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Oct 2005
    Posts
    26

    When page is done loading

    VB Code:
    1. Public ie As InternetExplorer
    2. Public ie1
    3.  
    4. OTHER CODE
    5.  
    6. Private Sub Form_Load()
    7. Set ie1 = CreateObject("InternetExplorer.Application")
    8.     ie1.Navigate2 "http://www.kingsofchaos.com/login.php?"
    9.     ie1.Visible = True
    10. End Sub

    Whats the event for when ie1 is done loading?
    Im fairly sure its simple, Ive just searched about 30-40 threads by now, and I dont know if Ill find it. Sorry for posting a new thread if I skipped over it accidentally

    Ive tried
    VB Code:
    1. Private Sub ie1_NavigateComplete2()
    2. Private Sub ie1_Navigate2Complete()
    3. Private Sub ie1_NavigateComplete()
    4. Private Sub ie1_Load()
    And some others

    Thanks for all your help, you guys are fast and smart =P


    Bear

  2. #2
    INXSIVE Bruce Fox's Avatar
    Join Date
    Sep 2001
    Location
    Melbourne, Australia
    Posts
    7,429

    Re: When page is done loading

    If you used a WebBrowser Control, you could use the WebBrowser1_DocumentComplete() Sub.

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Oct 2005
    Posts
    26

    Re: When page is done loading

    Web Browser control has to be inside the dialog form though, correct?


    Bear

  4. #4
    INXSIVE Bruce Fox's Avatar
    Join Date
    Sep 2001
    Location
    Melbourne, Australia
    Posts
    7,429

    Re: When page is done loading

    Yep.

    I have been searching ALLAPI.net for an API solution (no luck so far)

    Obviously, you need a method of determining when the page is finished loading from a shelled instance of IE.

  5. #5
    INXSIVE Bruce Fox's Avatar
    Join Date
    Sep 2001
    Location
    Melbourne, Australia
    Posts
    7,429

    Re: When page is done loading

    Check for: ie1.Busy

  6. #6
    INXSIVE Bruce Fox's Avatar
    Join Date
    Sep 2001
    Location
    Melbourne, Australia
    Posts
    7,429

    Re: When page is done loading

    This worked for me:
    VB Code:
    1. Option Explicit
    2.  
    3. Public ie As Object < Note: Your reference is different  ********************
    4. Public ie1
    5.  
    6. Private Sub Form_Load()
    7.     Set ie1 = CreateObject("InternetExplorer.Application")
    8.     ie1.Navigate2 "http://www.kingsofchaos.com/login.php?"
    9.     ie1.Visible = True
    10.  
    11.     Do While ie1.Busy = True
    12.         DoEvents
    13.     Loop
    14.  
    15.     MsgBox "Done"
    16.  
    17. End Sub

  7. #7

    Thread Starter
    Junior Member
    Join Date
    Oct 2005
    Posts
    26

    Re: When page is done loading

    I need it to react every time the page is reloaded, so I can parse the information
    Is that possible?


    Bear

  8. #8
    INXSIVE Bruce Fox's Avatar
    Join Date
    Sep 2001
    Location
    Melbourne, Australia
    Posts
    7,429

    Re: When page is done loading

    Quote Originally Posted by bearruler
    I need it to react every time the page is reloaded, so I can parse the information
    Is that possible?


    Bear

    This is now of course a new requirement to your original post, correct?

  9. #9

    Thread Starter
    Junior Member
    Join Date
    Oct 2005
    Posts
    26

    Re: When page is done loading

    No, forgot to mention it in my first post, I actually didnt think of just reacting on the first load
    But yes, it was not in my first post (though It should have been) i'll have to say correct


    Bear
    Last edited by bearruler; Nov 24th, 2005 at 04:05 PM.

  10. #10
    Fanatic Member
    Join Date
    Aug 2005
    Location
    South Africa
    Posts
    760

    Re: When page is done loading

    It would be a lot easier if you used the WebBrowser control, then you could use
    VB Code:
    1. Private Sub WebBrowser1_DocumentComplete(ByVal pDisp As Object, URL As Variant)
    2. 'Parse out text here...
    3. End Sub
    If I helped you out, please consider adding to my reputation!

    -- "The faulty interface lies between the chair and the keyboard" --

    VB6 Programs By Me:
    ** Dictionary, Thesaurus & Rhyme-Generator In One ** WMP Recent Files List Editor ** Pretty Impressive Clock ** Extract Firefox History **

  11. #11
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: When page is done loading

    You do realise if you just use "Public ie1", it types as Variant, when you really want it to be typed as an "Object" so you would need "Public ie1 As Object"

  12. #12
    PowerPoster Static's Avatar
    Join Date
    Oct 2000
    Location
    Rochester, NY
    Posts
    9,390

    Re: When page is done loading

    ok.. start over

    Add a Reference (Not the control.. just a ref) to MS Internet Control

    Now:
    VB Code:
    1. Dim WithEvents IE1 as InternetExplorer
    2.  
    3. Private Sub Form_Load()
    4. Set IE1 = New InternetExplorer
    5.     ie1.Navigate2 "http://www.kingsofchaos.com/login.php?"
    6.     ie1.Visible = True
    7. End Sub

    now.. in the object dropdown.. (Left dropdown in the codewindow...)
    Pick IE1...
    now look at your event dropdown.. (The right combo.. )
    U have ALL the events that can be used just like the Webbrowser Control.

    Use Document Complete event...
    VB Code:
    1. Private Sub IE1_DocumentComplete(ByVal pDisp As Object, URL As Variant)
    2.     If (pDisp Is IE1.Application) Then 'This checks to make sure the doc is FULLY loaded
    3.         If URL = "http://www.whatever.com" Then
    4.             'Do some code
    5.            
    6.         End If
    7.     End If
    8. End Sub
    JPnyc rocks!! (Just ask him!)
    If u have your answer please go to the thread tools and click "Mark Thread Resolved"

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width