[RESOLVED] Shouldn't WebBrowser1_DocumentComplete happen only once?
Hi, I have a program that displays a popup message when the webbrowser control finishes loading a page. The problem is I get between 3-5 messages as the page loads, like its loading 5 pages.
I use the procedure for "WebBrowser1_DocumentComplete" so I figured once the entire page is done, this will run but it runs multiple times. Is there anyway to limit this to runs once at the end of the page download? the popup is displaying information it reads from the page and the first 1-2 messages are blank becuase the page hasnt loaded that far yet. any help?
Re: Shouldn't WebBrowser1_DocumentComplete happen only once?
no actually it can trigger many times... (for example..For each frame..)
to check for it to be completely loaded do this:
VB Code:
Private Sub WebBrowser1_DocumentComplete(ByVal pDisp As Object, URL As Variant)
[B]If (pDisp is Webbrowser1.Application) Then[/B]
'do code here
End If
End Sub
Re: Shouldn't WebBrowser1_DocumentComplete happen only once?
Thanks static, you come through again in a pinch
Re: [RESOLVED] Shouldn't WebBrowser1_DocumentComplete happen only once?
A little side question, I am sure you probably can answer it static. Sometimes weather.com gives errors, the runtime ones that ask if you want to debug. Is there anyway to stop these types of errors? Actually all messages? I got the popups stopped using the NewWindow2 sub.
The reason I ask is that the form is hidden and once and a while this message might popup when the program reloads the webpage to get the newest temperatures.