vbscript中的sendkey问题 [英] Problem with sendkeys in vbscript
本文介绍了vbscript中的sendkey问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
向Windows应用程序发送密钥无效.我有以下代码
设置 objAP = CreateObject(" )
objAP.Run " ' aruser是Windows应用程序
objAP.AppActivate "
objAP.SendKeys " ,真
objAP.SendKeys " ,>真跨度>
objAP.SendKeys " ,真
当我运行此代码时,它将在VB脚本编辑器本身中打印"gananu",但我的要求是将"gananu"发送到Aruser应用程序.
有人可以帮忙吗?谢谢,ganga
解决方案
此示例[ 您是否尝试了链接示例(即问题可能不是脚本,而是您运行的应用程序)?
:)
感谢您的回复.我尝试使用此代码在excel工作表中创建一个命令按钮",然后运行,但仍然失败.的秒数,然后指定要激活的应用程序时间.
Sendkeys to windows application doesnt work. i have the following code
Set objAP = CreateObject("wscript.shell")
objAP.Run "aruser.exe" ' aruser is an windows application
objAP.AppActivate "aruser.exe"
objAP.SendKeys "gananu", True
objAP.SendKeys "{TAB}", True
objAP.SendKeys "gananu", True
When i run this code, it is printing ''gananu'' in VB script editor itself, but my requirement is to send ''gananu'' to aruser application.
Can someone help. Thanks, ganga
解决方案
This example [^] works on my system.
Did you try to run the.vbs
file outside the editor?
Please don''t add ''fake answers'': modify your original post (or write a new one).
Did you try the example of the link (i.e. maybe the problem is not the script, but the application you run)?
:)
thanks for the reply. i tried creating a "command button" in excel sheet with this code and then run, still it failed.
Try to use WScript.Sleep afther the AppActivate call to pause the script for a couple of seconds and give the application time to be activated.
这篇关于vbscript中的sendkey问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文