Skip to content

Latest commit

 

History

History
78 lines (48 loc) · 1.89 KB

Word.Application.KeysBoundTo.md

File metadata and controls

78 lines (48 loc) · 1.89 KB
title keywords f1_keywords api_name ms.assetid ms.date ms.localizationpriority
Application.KeysBoundTo property (Word)
vbawd10.chm158335046
vbawd10.chm158335046
Word.Application.KeysBoundTo
55967f9f-a2e0-eaae-a371-0fed82100138
06/08/2017
medium

Application.KeysBoundTo property (Word)

Returns a KeysBoundTo object that represents all the key combinations assigned to the specified item.

Syntax

expression. KeysBoundTo( _KeyCategory_ , _Command_ , _CommandParameter_ )

expression A variable that represents an Application object. Optional.

Parameters

Name Required/Optional Data type Description
KeyCategory Required WdKeyCategory The category of the key combination.
Command Required String The name of the command.
CommandParameter Optional Variant Additional text, if any, required for the command specified by Command. For more information, see the "Remarks" section in the Add method for the KeyBindings object.

Example

This example displays all the key combinations assigned to the FileOpen command in the template attached to the active document.

Dim kbLoop As KeyBinding 
Dim strOutput As String 
 
CustomizationContext = ActiveDocument.AttachedTemplate 
 
For Each kbLoop In _ 
 KeysBoundTo(KeyCategory:=wdKeyCategoryCommand, _ 
 Command:="FileOpen") 
 strOutput = strOutput & kbLoop.KeyString & vbCr 
Next kbLoop 
 
MsgBox strOutput

This example removes all key assignments from Macro1 in the Normal template.

Dim aKey As KeyBinding 
 
CustomizationContext = NormalTemplate 
For Each aKey In _ 
 KeysBoundTo(KeyCategory:=wdKeyCategoryMacro, _ 
 Command:="Macro1") 
 aKey.Disable 
Next aKey

See also

Application Object

[!includeSupport and feedback]