这样就可以了Private Sub WebBrowser1_NavigateComplete2(ByVal pDisp As Object, URL As Variant) Dim obj As HTMLDocument Set obj = pDisp.Document obj.parentWindow.execScript "function showModalDialog(){return;}" End Sub
to hhjjhjhj(大头)(想变胡萝卜^^) 如果不运行script的话,会影响到页面其它的正常脚本的运行啊高手,还有没有更好的办法
.Document.DesignMode = "on" '设计模式设计模式 设计模式 设计模式
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long ShellExecute frmDisplay.hwnd, vbNullString, "http://www.sina.com", vbNullString, vbNullString, SW_SHOWNORMAL
Dim obj As HTMLDocument
Set obj = pDisp.Document
obj.parentWindow.execScript "function showModalDialog(){return;}"
End Sub
和
WebBrowse_DownloadComplete()
中加入
WebBrowse.Silent = True
这样试验一下啊,或许可以.
在设计那里更改成true无效,每次都自动换成false了.
编译-用户类型未定义
谢谢你的办法,我先试一下
另外是否有办法能把 of123() 所述的问题很好的屏弊?
你的方法是禁止显示脚本错误信息的,对这个没用
.Navigate "about:blank"
.Document.DesignMode = "on" '设计模式,不会运行script
.Document.Location = "http://www.abc.com/xx.html"
MsgBox "请等待网页加载完毕".Document.write Replace(.Document.documentElement.outerHTML, "some words", "")
.Document.DesignMode = "off"
End With
如果不运行script的话,会影响到页面其它的正常脚本的运行啊高手,还有没有更好的办法
设计模式
设计模式
ShellExecute frmDisplay.hwnd, vbNullString, "http://www.sina.com", vbNullString, vbNullString, SW_SHOWNORMAL