如题
弹出窗口一般是由window.open产生,这个可以解决,
但网页对话框是由showModalDialog产生,实在想不通怎么解决,望高手指点!

解决方案 »

  1.   

    这样就可以了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
      

  2.   

    关注,顺便问问,对于用window.confirm弹出的窗口怎么跳过
      

  3.   

    是否可以考虑用 FindWindow 和 SendMessage API 来处理?
      

  4.   

    使用函数重载的方法其实就跟API拦截差不多的道理,可以写个和原函数有一样参数列表的函数,这样就可以知道判断是否是我们需要拦截的函数,以及决定是否调用原函数confirm函数也可以象上面那样弄的,只要把函数名改成confirm就可以了
      

  5.   

    在WebBrowse_DownloadBegin()

    WebBrowse_DownloadComplete()
    中加入
    WebBrowse.Silent = True
    这样试验一下啊,或许可以.
    在设计那里更改成true无效,每次都自动换成false了.
      

  6.   

    Dim obj As HTMLDocument
    编译-用户类型未定义
      

  7.   

    引用Microsoft HTML Object Library
      

  8.   

    to supergreenbean(超级绿豆 - 要准备发芽了)
    谢谢你的办法,我先试一下
    另外是否有办法能把 of123() 所述的问题很好的屏弊?
      

  9.   

    to xghim(小飞)
    你的方法是禁止显示脚本错误信息的,对这个没用
      

  10.   

    对网页的html进行处理后再让它运行。With Me.WebBrowser1
    .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
      

  11.   

    to hhjjhjhj(大头)(想变胡萝卜^^) 
    如果不运行script的话,会影响到页面其它的正常脚本的运行啊高手,还有没有更好的办法
      

  12.   

    .Document.DesignMode = "on"        '设计模式设计模式
    设计模式
    设计模式
      

  13.   

    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