Dim doc As IHTMLDocument2 Dim sElement As IHTMLSelectElement Dim btnElement As IHTMLElementPrivate Sub Form_Load() WebBrowser1.navigate "http://www.pxdisk.com/u/a.htm"End SubPrivate Sub WebBrowser1_DocumentComplete(ByVal pDisp As Object, URL As Variant)
If URL = "http://www.pxdisk.com/u/a.htm" Then Set doc = pDisp.document Set sElement = doc.All.tags("select")(0) sElement.selectedIndex = 2 Set btnElement = doc.All.tags("A")(0) btnElement.Click End If
If URL = "http://www.pxdisk.com/u/b.asp" Then Set doc = pDisp.document Set btnElement = doc.All.tags("A")(2) btnElement.Click End If
Dim sElement As IHTMLSelectElement
Dim btnElement As IHTMLElementPrivate Sub Form_Load() WebBrowser1.navigate "http://www.pxdisk.com/u/a.htm"End SubPrivate Sub WebBrowser1_DocumentComplete(ByVal pDisp As Object, URL As Variant)
If URL = "http://www.pxdisk.com/u/a.htm" Then
Set doc = pDisp.document
Set sElement = doc.All.tags("select")(0)
sElement.selectedIndex = 2
Set btnElement = doc.All.tags("A")(0)
btnElement.Click
End If
If URL = "http://www.pxdisk.com/u/b.asp" Then
Set doc = pDisp.document Set btnElement = doc.All.tags("A")(2)
btnElement.Click
End If
End Sub引用MSHTML对象。
请问下
1: IHTMLDocument2 和 IHTMLDocument 和 HTMLDocument 这3个有啥区别啊,为什么有的前面加i有的不加啊,还有最后那个22:你定义这些还要引用MSHTML,可是把这些都去掉不引用一样可以运行啊,为什么要多这些呢?3:MSHTML方面的资料那里能看到?
2,可以,不过写的时候打点不带方法。
3,那些资料啊,我当初有个SDK,现在没了。不过还有什么不知道的,自己看看里面的就知道了。
要不再多给点分,哈哈,我一点点告诉你。HOHO