如何在VBA中双击Web对象 [英] how to double click web object in VBA

查看:144
本文介绍了如何在VBA中双击Web对象的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用VBA自动化Web流程.我使用

I am automating a web process with VBA. I go find an object on a webpage using

IE.document.getelementsbytagname

等.找到该对象后,您可以使用来单击.

etc.. Once that object is found, you can single click using

 objElement.click

问题是,如何双击?我所有的搜索都一无所获.我以为dblClick或doubleClick可以解决问题,但这是无效的方法.我通过使用

The question is, how do I double click?? All my searches have come up with nothing. I thought dblClick or doubleClick would do the trick, but those are invalid methods. I tried a workaround by using

objElement.click
sendkeys "{ENTER}"

点击然后点击回车会打开链接,但这也不起作用.

to click and then hitting enter would open the link, but that doesn't work either.

推荐答案

我终于可以正常工作了:

I finally got this working:

objElement.click
objElement.FireEvent "ondblclick", 1, 2

这篇关于如何在VBA中双击Web对象的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆