-
June 12th, 2005, 12:16 AM
#1
WebBrowser DocumentComplete & Frames Problem
I have the following trouble with the documentcomplete event.
--------------------
Private Sub WebBrowser1_DocumentComplete(ByVal pDisp As Object, URL As
Variant)
Text3.Text = _ WebBrowser1.Document.frames(3).Document.body.innertext
End Sub
----------------
The problem is that the Documentcomplete sub routine fires before the page
shows in the webbrowser window. I have tried with for next loops and the
timer control to force delays several praces in the code, but that seems to
halt the web browser control.
If I add a message box and wait till the page shows, it works fine.
Any help will be highly appreaciated as this problem is driving me mad! :-)
Best regards
pokpoki
-
June 12th, 2005, 07:03 AM
#2
Re: WebBrowser DocumentComplete & Frames Problem
Have you tried the downloadcomplete instead of documentcomplete?
Intelligent people talks because they have something to say,
Fools talk because they have to say something....
-
June 12th, 2005, 11:08 AM
#3
Re: WebBrowser DocumentComplete & Frames Problem
This is from the Microsoft website:
Code:
Private Sub myIE_DocumentComplete(ByVal pDisp As Object, URL As Variant)
If pDisp Is myIE Then
DocComplete = True
End If
End Sub
And then test:
Code:
DocComplete = False '<---- set module level boolean variable
myIe.navigate ("http:\yourpage.com") '<---- Load Page here
Do Until DocComplete = True
DoEvents
Loop
Text3.Text = MyIE.Document.frames(3).Document.body.innertext
This code ensures that the whole page is loaded.
Last edited by Relentless; June 13th, 2005 at 08:57 AM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|