Dim obj As HTMLDocument Set obj = pDisp.Document obj.parentWindow.execScript End Sub
而confirm引发的对话确定框可用confirm替换showModalDialog即可,Alert等同理~
WebBrowser取得网页源码Private Sub Command1_Click() WebBrowser1.Navigate \End Sub
Private Sub WebBrowser1_DownloadComplete() '页面下载完毕 Dim doc, objhtml
Set doc = WebBrowser1.Document
Set objhtml = doc.body.createtextrange() If Not IsNull(objhtml) Then Text1.Text = objhtml.htmltext End If
End Sub
我用WebBrowser取得网页源码,直接运行正常,但在编译后出错
提示:实时错误“91” Object 变量或 with 块变量没有设置 可能是没有下载完所致,
Private Sub WebBrowser1_DownloadComplete() if webbrowser.busy=false then Dim doc, objhtml
Set doc = WebBrowser1.Document
Set objhtml = doc.body.createtextrange() If Not IsNull(objhtml) Then Text1.Text = objhtml.htmltext End If end if End Sub
\
showModalDialog(){return;}\
'
对
showModalDialog引起的对话框进行确定
相关推荐: