|
|
|
|
|
up
|
|
|
Private Sub WebBrowser1_NewWindow2(ppDisp As Object, Cancel As Boolean)
MsgBox "OK" Cancel = True End Sub |
|
|
to 大头。
你说的方法只是禁止打开新窗口。怎么得到要打开的新窗口的地址呢? |
|
|
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 |
|
|
to 大头
不行老是提示一个错误,实时错误13,类型不匹配。 |
|
|
有相关的例程吗?
其实我想做的效果就和腾讯的浏览器一样。它打开新窗口的时候也是在当前窗口打的。 谢谢。。 |
|
|
litaoa(青云)
要手工引用一下如下这个DLL \WINDOWS\SYSTEM\SHDOCVW.DLL (我在OFFICE的VBA中试时,WebBrowser直接来自SHDOCVW.DLL,VB6中还是来自SHDOCVW.oca) |
|