窗口一代码:
Dim WithEvents Web_V1 As SHDocVwCtl.WebBrowser_V1
Private Sub Form_Load()
Set Web_V1 = WebBrowser1.Object
WebBrowser1.Silent = True
WebBrowser1.Navigate "网址"
End Sub
Private Sub Web_V1_NewWindow(ByVal URL As String, ByVal Flags As Long, ByVal TargetFrameName As String, PostData As Variant, ByVal Headers As String, Processed As Boolean)
Processed = True
Form2.WebBrowser1.Navigate URL
Form2.Show
End Sub
Dim URL1
Private Sub Form_Load()
WebBrowser1.Navigate "www.baidu.com"
Form2.Show
End Sub
Private Sub WebBrowser1_BeforeNavigate2(ByVal pDisp As Object, URL As Variant, Flags As Variant, TargetFrameName As Variant, PostData As Variant, Headers As Variant, Cancel As Boolean)
URL1 = URL
End Sub
Private Sub WebBrowser1_NewWindow2(ppDisp As Object, Cancel As Boolean)
Cancel = True
Form2.WebBrowser1.Navigate URL1
End Sub