【发布时间】:2019-07-28 21:53:51
【问题描述】:
为了使用SendKeys 方法,我编写了一个非常简单的VBS 程序,以便其他程序可以调用它。当我只是写出一个简单的字符串来测试它时:
Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.SendKeys "testing"
它工作得很好。但是当我使用等价变量代替字符串时:
Set WshShell = WScript.CreateObject("WScript.Shell")
Set thingy = "testing"
WshShell.SendKeys thingy
调用时会报如下错误:
【问题讨论】:
标签: variables vbscript runtime-error sendkeys