请问vb如何模拟点击点按钮
请问vb如何模拟点击点按钮,我想点击那个发送邮件的按钮<tr><tdalign="right"><buttontype="button"value="分组管理">联系人组...
请问vb如何模拟点击点按钮,我想点击那个发送邮件的按钮
<tr>
<td align="right">
<button type="button" value="分组管理">联系人组管理</button>
</td>
<td>
<button type="button" value="联系人管理">联系人管理</button>
</td>
<td></td>
<td></td>
<td align="right">
<button type="button" value="发送邮件">发送短信</button>
</td>
</tr> 展开
<tr>
<td align="right">
<button type="button" value="分组管理">联系人组管理</button>
</td>
<td>
<button type="button" value="联系人管理">联系人管理</button>
</td>
<td></td>
<td></td>
<td align="right">
<button type="button" value="发送邮件">发送短信</button>
</td>
</tr> 展开
展开全部
Private Sub Command1_Click() '攻击按钮
Dim Vdoc,i, S As String
On Error Resume Next
For i = 0 To WebBrowser1.Document.All.length - 1
Set Vdoc = WebBrowser1.Document.All(i)
If UCase(Vdoc.tagname) = "button" Then
S = Trim(Vdoc.innertext)
If s="发送邮件" Then
Vdoc.click
End If
End If
DoEvents
Next
End Sub
Dim Vdoc,i, S As String
On Error Resume Next
For i = 0 To WebBrowser1.Document.All.length - 1
Set Vdoc = WebBrowser1.Document.All(i)
If UCase(Vdoc.tagname) = "button" Then
S = Trim(Vdoc.innertext)
If s="发送邮件" Then
Vdoc.click
End If
End If
DoEvents
Next
End Sub
展开全部
Private Sub Command1_Click()
For Each obj In WebBrowser1.Document.getelementsbytagname("button")
If obj.innertext = "发送短信" Then Print obj.Click
Next
End Sub
For Each obj In WebBrowser1.Document.getelementsbytagname("button")
If obj.innertext = "发送短信" Then Print obj.Click
Next
End Sub
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
Call Button1.PerformClick()
vb2010代码
vb6.0没用过~
vb2010代码
vb6.0没用过~
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询