主题:网页填写表格问题
我做好的源码
Private Sub Command1_Click()
Dim vDoc, vTag
Dim i As Integer
Set vDoc = WebBrowser1.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 = "text" Then '检测类型
Select Case vTag.Name
Case "ti" '标题框的值
vTag.Value = "ad"
End Select
End If
If vTag.Type = "textarea" Then '检测内容框类型
Select Case vTag.Name
Case "co" '内容
vTag.Value = "12"
End Select
End If
If vTag.Type = "text" Then '检测图片框类型
Select Case vTag.Name
Case "str1" '图片
vTag.Value = "12"
End Select
End If
If vTag.Type = "submit00" And vTag.Value = "发表贴子" Then '登陆按钮
vTag.Select '也可以没有这个
vTag.Click '点击提交了,一切都OK了
End If
End If
Next i
End Sub
Private Sub Form_Load()
WebBrowser1.Navigate "http://tieba.baidu.com/f?kw=vb+%D7%D4%B6%AF%CC%EE%D0%B4%B1%ED%B5%A5"
End Sub
问题是不可以填写内容.请帮改下
Private Sub Command1_Click()
Dim vDoc, vTag
Dim i As Integer
Set vDoc = WebBrowser1.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 = "text" Then '检测类型
Select Case vTag.Name
Case "ti" '标题框的值
vTag.Value = "ad"
End Select
End If
If vTag.Type = "textarea" Then '检测内容框类型
Select Case vTag.Name
Case "co" '内容
vTag.Value = "12"
End Select
End If
If vTag.Type = "text" Then '检测图片框类型
Select Case vTag.Name
Case "str1" '图片
vTag.Value = "12"
End Select
End If
If vTag.Type = "submit00" And vTag.Value = "发表贴子" Then '登陆按钮
vTag.Select '也可以没有这个
vTag.Click '点击提交了,一切都OK了
End If
End If
Next i
End Sub
Private Sub Form_Load()
WebBrowser1.Navigate "http://tieba.baidu.com/f?kw=vb+%D7%D4%B6%AF%CC%EE%D0%B4%B1%ED%B5%A5"
End Sub
问题是不可以填写内容.请帮改下