QTP:使用Ctrl键组合的Sendkey方法不起作用

问题描述 投票:0回答:1

我想在VBA脚本中使用快捷键而不是单击对象。所以我使用下面的代码(^ F6)按“ctrl + F6”。但它不起作用并显示语法错误。

SAPGuiSession("Session").SAPGuiWindow("Aufteiler anlegen : Einstieg").SendKey  ^F6

但是,“SHIFT + F6”+ F6完美运行。有人能想出来吗?

vbscript qtp sendkeys
1个回答
0
投票

QTP不会将^转换为控制,而是使用special constant micCtrl。这样的东西可能有效(未经测试)

With SAPGuiSession("Session").SAPGuiWindow("Aufteiler anlegen : Einstieg")
    .SendKey micCtrlDown
    .SendKey micF6
    .SendKey micCtrlUp
End With
© www.soinside.com 2019 - 2024. All rights reserved.