如何判断 WebBrowser 内网页弹出对话框,并自动点击确定按钮。

解决方案 »

  1.   


    Private Sub WebBrowser1_NewWindow2(ppDisp As Object,
                                       Cancel As Boolean)
       Set ppDisp = nothing
    End Sub复杂的方法
    implement IDocHostShowUI,
    在IDocHostShowUI_ShowMessage中处理,
    代码这里有,http://community.csdn.net/Expert/TopicView.asp?id=4232137
      

  2.   

    网页反回下面脚本对话框
    <script language='javascript'>alert('..');history.back();</script>
    如何自动点击呢?
      

  3.   

    Private Sub WebBrowser2_NavigateComplete2(ByVal pDisp As Object, URL As Variant)
        
        On Error GoTo ErrHandler
        
        txtHTML.Text = Left(WebBrowser2.Document.body.innerText, 1)
        
    ErrHandler:    If Err.Number = 91 Then
            Me.Show
            Me.WindowState = 0
            SendKeys "{enter}", 0.5
            SendKeys "n", 0.5
        End IfEnd Sub
      

  4.   

    http://community.csdn.net/Expert/topic/4350/4350112.xml
    请不要一帖多发。