WPS 基础接口 > 文字 API 参考 > Application > 属性 > Application.FindKey 属性
返回 KeyBinding 对象,该对象代表指定的组合键。只读。

语法

表达式.FindKey(KeyCode, KeyCode2)

表达式   可选。返回 Application 对象的表达式。

参数

名称 必选/可选 数据类型 说明
KeyCode 必选 Long WdKey 常量之一指定的一个键。
KeyCode2 可选 Variant WdKey 常量之一指定的第二个键。

说明

可用 BuildKeyCode 方法创建 KeyCodeKeyCode2 参数。

示例

本示例取消活动文档模板中的 Alt+Shift+F12。要返回包含不止两个键的 KeyBinding 对象,请用 BuildKeyCode 方法,如本例所示。

示例代码
let CustomizationContext = ActiveDocument.AttachedTemplate
FindKey(BuildKeyCode(wdKeyAlt, wdKeyShift, wdKeyF12)).Disable()

本示例显示 F1 指向的命令。

示例代码
CustomizationContext = NormalTemplate
MsgBox(FindKey(wdKeyF1).Command)

find key


请参阅