Private Sub WB_NewWindow2(ppDisp As Object, Cancel As Boolean)On Error Resume NextCancel = TrueWB.Navigate WB.Document.activeElement.hrefErr.ClearEnd Sub
上面是一段VB代码,意思是用阻止Webbrowser打开新窗口行为,并在当前控件打开当前连接。