返回一个
KeyBindings 集合,该集合代表自定义的按键指定方案,包含了键代码、键类别和命令。
语法
表达式.KeyBindings
表达式 一个代表 Application 对象的变量。
示例
本示例将 Ctrl+Alt+W 指定给 FileClose 命令。这个键盘自定义方案保存在“Normal”模板中。
示例代码 |
CustomizationContext = NormalTemplate
KeyBindings.Add(wdKeyCategoryCommand, "FileClose", BuildKeyCode(wdKeyControl, wdKeyAlt, wdKeyW))
|
本示例为 KeyBindings 集合中的每项插入命令名称和组合键字符串。
示例代码 |
CustomizationContext = NormalTemplate
for(let i = 1; i <= KeyBindings.Count; i++) {
Selection.InsertAfter(KeyBindings.Item(i).Command + "\t" + KeyBindings.Item(i).KeyString + "\r")
Selection.Collapse(wdCollapseEnd)
}
|
find all keybinding objects