-
Fully load IE
Working in VB.
I need to make it wait until the page called in IE loads before going to the next command. I have just been using a pause but page keeps loading at different times and program keeps messing up.
Anyone know a code to make it wait for IE to fully load before continuing?
Any help is appreciated.
-
You need to set a refrence to the Microsoft Internet Controls
Code:
Option Explicit
Dim WithEvents mIE As InternetExplorer
Private Sub cmdSendHTML_Click()
Dim TestDoc As HTMLDocument
Set TestDoc = mIE.document
TestDoc.body.innerHTML = txtHTML
End Sub
Private Sub Form_Load()
Set mIE = New InternetExplorer
mIE.Visible = True
mIE.navigate "www.microsoft.com"
End Sub
Private Sub mIE_DocumentComplete(ByVal pDisp As Object, URL As Variant)
If pDisp Is mIE Then
MsgBox "Document is ready"
End If
End Sub