Dim vDoc, vTag
Dim i As Integer
Set vDoc = ie.Document
For i = 0 To vDoc.All.length - 1 '检测所有标签
If UCase(vDoc.All(i).tagname) = "INPUT" Then '找到input标签
Set vTag = vDoc.All(i)
If vTag.Name = "LinkName" Then
vTag.Value = "上海汽车租赁" '这个是输入到用户名中得值
End If
If vTag.Name = "LinkUrl" Then
vTag.Value = "http://www.leicheng168.com" '这个是输入到密码框中的值
End If
If vTag.Type = "textarea" Then
Select Case vTag.Name
Case "Readme"
Document.All(i).Value = "我的值"
End Select
End If
If vTag.Type = "password" Then
vTag.Value = "111" '这个是输入到密码框中的值
End If
If vTag.Type = "submit" Then
vTag.Click
End If
End If
Next i
End Sub
Private Sub Command2_Click()
Dim vDoc, vTag
Dim i As Integer
Set vDoc = ie.Document
For i = 0 To vDoc.All.length - 1 '检测所有标签
If UCase(vDoc.All(i).tagname) = "INPUT" Then '找到input标签
Set vTag = vDoc.All(i)
If vTag.Type = "submit" Then
vTag.Click '点击确定键
End If
End If
Next i
End Sub
为什么只有textarea 不能填入.其他的都可以.高手相助