I am doing IE automation. Everything is fine until a new window is created. How do I take control of this new window exactly like the original window?
Public WithEvents IE As InternetExplorer
Private Sub Form_Load()
Set IE = New InternetExplorer
IE.Visible = True
Private Sub IE_NewWindow2(ppDisp As Object, Cancel As Boolean)
Dim WBform1 As Form1
Set WBform1 = New Form1
Set WBform1.IE = New InternetExplorer
Set ppDisp = WBform1.IE
Setting ppDisp to WBform1.IE does not seem to work because the new window is not limited by the conditions I placed on its BeforeNavigate2 event.
Any help would be much appreciated. Thanks!