dim doc as CObject
doc.SetObject me.WebBrowser1.Document'先獲取WebBrowser1控件的文檔接口
doc.Get("getElementById" ,"kw").Put("value" ,"test")'調用getElementById方法獲得百度kw文本框,并設置value為test
if doc.IsErr Then PrintA doc.ErrDescription'顯示錯誤
doc.ClearErr'清除錯誤
doc.Get("getElementById" ,"su").Run("click")'獲得百度一下按鈕并點擊
Dim pw As CObject = Doc.Get("parentWindow")'獲得parentWindow接口
pw.Run("execScript","alert('1')")'調用execScript方法運行js命令alert('1')