KeyString 方法

       

为指定的键返回组合键字符串(例如,Ctrl+Shift+A)。

expression.KeyString(KeyCode, KeyCode2)

expression   可选。该表达式返回一个 Application 对象。

KeyCode   Long 类型,必需。用 WdKey 常量指定的一个键。

KeyCode2   Variant 类型,可选。用 WdKey 常量指定的第二个键。

说明

可用 BuildKeyCode 方法创建 KeyCodeKeyCode2 参数。

示例

本示例为 wdKeyControlwdKeyShiftwdKeyAWdKey 常量显示组合键字符串 (Ctrl+Shift+A)。

CustomizationContext = ActiveDocument.AttachedTemplate
MsgBox KeyString(KeyCode:=BuildKeyCode(wdKeyControl, _
    wdKeyShift, wdKeyA))