When page is done loading
VB Code:
Public ie As InternetExplorer
Public ie1
OTHER CODE
Private Sub Form_Load()
Set ie1 = CreateObject("InternetExplorer.Application")
ie1.Navigate2 "http://www.kingsofchaos.com/login.php?"
ie1.Visible = True
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:
Private Sub ie1_NavigateComplete2()
Private Sub ie1_Navigate2Complete()
Private Sub ie1_NavigateComplete()
Private Sub ie1_Load()
And some others
Thanks for all your help, you guys are fast and smart =P
Bear
Re: When page is done loading
If you used a WebBrowser Control, you could use the WebBrowser1_DocumentComplete() Sub.
Re: When page is done loading
Web Browser control has to be inside the dialog form though, correct?
Bear
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.
Re: When page is done loading
Re: When page is done loading
This worked for me:
VB Code:
Option Explicit
Public ie As Object < Note: Your reference is different ********************
Public ie1
Private Sub Form_Load()
Set ie1 = CreateObject("InternetExplorer.Application")
ie1.Navigate2 "http://www.kingsofchaos.com/login.php?"
ie1.Visible = True
Do While ie1.Busy = True
DoEvents
Loop
MsgBox "Done"
End Sub
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
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?
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
Re: When page is done loading
It would be a lot easier if you used the WebBrowser control, then you could use
VB Code:
Private Sub WebBrowser1_DocumentComplete(ByVal pDisp As Object, URL As Variant)
'Parse out text here...
End Sub
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" ;)
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:
Dim WithEvents IE1 as InternetExplorer
Private Sub Form_Load()
Set IE1 = New InternetExplorer
ie1.Navigate2 "http://www.kingsofchaos.com/login.php?"
ie1.Visible = True
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:
Private Sub IE1_DocumentComplete(ByVal pDisp As Object, URL As Variant)
If (pDisp Is IE1.Application) Then 'This checks to make sure the doc is FULLY loaded
If URL = "http://www.whatever.com" Then
'Do some code
End If
End If
End Sub