'引用Microsoft Internet Controls
Dim IE As InternetExplorer
Private Sub Form_Load()
Set IE = New InternetExplorer
IE.Navigate "http://office.9zp.com"
IE.Visible = True
End Sub
Private Sub Command1_Click()
IE.Document.links(5).Click
End Sub
'Private Sub Command1_Click()
' WebBrowser1.Navigate2 "http://localhost\test.htm"
'End Sub
'Private Sub WebBrowser1_DocumentComplete(ByVal pDisp As Object, URL As Variant)
' Dim vDoc, vTag
' Dim i As Integer
'Set vDoc = WebBrowser1.Document
' List1.Clear
' For i = 0 To vDoc.All.length - 1
' If UCase(vDoc.All(i).tagName) = "INPUT" Then
' Set vTag = vDoc.All(i)
' If vTag.Type = "text" Or vTag.Type = "password" Then
' List1.AddItem vTag.Name
' Select Case vTag.Name
' Case "Name"
' vTag.Value = "IMGod"
' Case "NickName"
' vTag.Value = "IMGod"
' Case "Password"
' vTag.Value = "IMGodpass"
' Case "EMail"
' vTag.Value = "IMGod@paradise.com"
' End Select
在这里提交
' ElseIf vTag.Type = "submit" Then
' vTag.Click
' End If
' End If
'Next i
'End Sub
谢谢 hhjjhjhj(大头),我实际上只用了下面这一个部分就搞定了。
'引用Microsoft Internet Controls
Dim IE As InternetExplorer
Private Sub Form_Load()
Set IE = New InternetExplorer
IE.Navigate "http://office.9zp.com"
IE.Visible = True
End Sub