【问题标题】:QTP : Sendkey method with the combination of Ctrl key doesn't workQTP:使用 Ctrl 键组合的 Sendkey 方法不起作用
【发布时间】:2020-03-06 11:02:55
【问题描述】:

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

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

但是,“SHIFT + F6”的 +F6 效果很好。有没有人能看出来?

【问题讨论】:

    标签: vbscript qtp sendkeys


    【解决方案1】:

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

    With SAPGuiSession("Session").SAPGuiWindow("Aufteiler anlegen : Einstieg")
        .SendKey micCtrlDown
        .SendKey micF6
        .SendKey micCtrlUp
    End With
    

    【讨论】:

      猜你喜欢
      • 2016-02-22
      • 1970-01-01
      • 1970-01-01
      • 2019-04-29
      • 2018-01-21
      • 1970-01-01
      • 2014-06-04
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多