你应该尝试一下这样的:
set ws = CreateObject("WScript.shell")
ws.SendKeys chr(233)
编辑:
Dim i,x,a,ws
i = InputBox("Entrer un caractère ou une phrase pour obtenir son Code Unicode Correspondant !","test","éè@!%")
If i <> "" Then
For x = 1 To Len(i)
If x <> Len(i) Then
a = a & "ChrW(" & AscW(Mid(i,x,1)) & ")" & "&"
Else
a = a & "ChrW(" & AscW(Mid(i,x,1)) & ")"
End if
Next
Inputbox "Le Code Unicode Correspondant pour " & qq(i) & " est:",,a
End If
wscript.sleep 5000
set ws = CreateObject("WScript.shell")
ws.SendKeys qq(i)
'******************************************************************
Function qq(strIn)
qq = Chr(34) & strIn & Chr(34)
End Function
'******************************************************************
这不是键盘上的一个键,不会有一个虚拟键码。 SendKeys不具有国际意识,并且对大多数问题都没有很好的解决方案。任何测试自动化工具都应该具有更强大的功能,例如Microsoft自己的UI Automation。 –
我注意到你把这个标记为UFT问题。是否有特殊的理由使用'SendKeys'而不是使用对象的'.Set'方法?正如@Cody所述,'SendKeys'是一个糟糕的解决方案,我会避免它 –