使用SendKeys来';类型';VBScript中的变量

使用SendKeys来';类型';VBScript中的变量,vbscript,Vbscript,SendKeys可以键入变量吗?比如说 Set ws = CreateObject("WScript.Shell") Set TypeThis = I Want it to type whats here ws.SendKeys [I want it to type the variable(TypeThis] ws.SendKeys "{ENTER}" Wscript.sleep 100 只需将变量作为参数传递给SendKeys方法即可。如果要为变量赋值,则不应使用关键字set。仅当要将引用

SendKeys可以键入变量吗?比如说

Set ws = CreateObject("WScript.Shell")
Set TypeThis = I Want it to type whats here
ws.SendKeys [I want it to type the variable(TypeThis]
ws.SendKeys "{ENTER}"
Wscript.sleep 100

只需将变量作为参数传递给
SendKeys
方法即可。如果要为变量赋值,则不应使用关键字
set
。仅当要将引用指定给对象时才使用它

Set ws = CreateObject("WScript.Shell")
typeThis = "I Want it to type whats here"
ws.SendKeys typeThis
WScript.sleep 1000

只需将变量作为参数传递给
SendKeys
方法即可。如果要为变量赋值,则不应使用关键字
set
。仅当要将引用指定给对象时才使用它

Set ws = CreateObject("WScript.Shell")
typeThis = "I Want it to type whats here"
ws.SendKeys typeThis
WScript.sleep 1000