Private WithEvents newIe As InternetExplorer
Private WithEvents newIewin As ShellWindows
Dim isnew As Boolean
Private Sub Command1_Click()
Set newIewin = New ShellWindows
WebBrowser1.Navigate "http://office.9zp.com/index.asp"
End Sub
Private Sub newIe_DocumentComplete(ByVal pDisp As Object, URL As Variant)
If newIe.LocationURL <> "" Then
MsgBox newIe.LocationURL
newIe.Quit
End If
End Sub
Private Sub newIewin_WindowRegistered(ByVal lCookie As Long)
If isnew Then
Set newIe = newIewin.Item(newIewin.Count - 1)
End If
End Sub
Private Sub WebBrowser1_NewWindow2(ppDisp As Object, Cancel As Boolean)
isnew = True
End Sub