Application.KeyBindings プロパティ (Word)

キー コード、キー カテゴリ、およびコマンドは、ユーザー設定のキーの割り当てを表す KeyBindings コレクションを返します。

構文

expression. KeyBindings

expressionApplicationオブジェクトを表す変数 。

次の使用例は、CTRL + ALT + W キーの組み合わせを FileClose コマンドに割り当てます。 このキーボードのユーザー設定は、標準テンプレートに保存されます。

CustomizationContext = NormalTemplate 
KeyBindings.Add KeyCode:=BuildKeyCode(wdKeyControl, wdKeyAlt, _ 
 wdKeyW), KeyCategory:=wdKeyCategoryCommand, _ 
 Command:="FileClose"

次の使用例は、KeyBindings コレクションのコマンド名と各項目のキーの組み合わせを表す文字列を挿入します。

Dim kbLoop As KeyBinding 
 
CustomizationContext = NormalTemplate 
For Each kbLoop In KeyBindings 
 Selection.InsertAfter kbLoop.Command & vbTab _ 
 & kbLoop.KeyString & vbCr 
 Selection.Collapse Direction:=wdCollapseEnd 
Next kbLoop

関連項目

Application オブジェクト

サポートとフィードバック

Office VBA またはこの説明書に関するご質問やフィードバックがありますか? サポートの受け方およびフィードバックをお寄せいただく方法のガイダンスについては、Office VBA のサポートおよびフィードバックを参照してください。