How to confirm a Web Page Download is Complete?

  • Thread starter Thread starter Sean
  • Start date Start date
S

Sean

I know there has been a lot of questions and answers on this topic, But
I still don't have a clear understanding of how this works in VB6. So
here is what I did to really make sure that the webpage has been
downloaded completely before my program proceeds to click the order
entry confirmation button. But from time to time, when there are many
order entry transations, the dreadful run time error message "Object or
structure not found" shows up and crash my program.

'first checking
'==========
Web3Ready = False
strWaiting = "Web3"
Do While Not Web3Ready '
DoEvents
Loop

'second checking
'=============
Do While Form1.WebBrowser3.Busy
DoEvents
Loop


'third checking
'==========
If IsObject(Form1.WebBrowser3.Document.All.Item("OrderEntry1:_ctl13"))
Then
Form1.WebBrowser3.Document.All.Item("OrderEntry1:_ctl13").Click
End If
 
Sean,

Is this for Net 2.0 using the webbrowser from that or is it the
Axwebbrowser, for the last you can use the downloadcomplete2 event.

For the first has Herfried written a nice solution in this newsgroup,
\\\
Private Sub WebBrowser1_DocumentCompleted( _
ByVal sender As Object, _
ByVal e As WebBrowserDocumentCompletedEventArgs _
) Handles WebBrowser1.DocumentCompleted
If Me.WebBrowser1.ReadyState = WebBrowserReadyState.Complete Then
MsgBox("Document and frames loaded!")
End If
End Sub
///

I hope this helps,

Cor
 
Hi Cor,

Thanks for the posting and your kind advice.

My environment is neither Net2.0 nor Axwebbrowser, but simple VB6.0 in
Microsoft visual studio 6.0. I am not sure whether I can still use your
quoted solution, but will try in my environment.

Thanks again.

Sean
 
Back
Top