Partager via


KeyBinding.Command Property (Word)

Returns the command assigned to the specified key combination. Read-only String.

Syntax

expression .Command

expression A variable that represents a KeyBinding object.

Example

This example displays the keys assigned to font names. A message is displayed if no keys have been assigned to fonts.

Dim kbLoop As KeyBinding 
 
For Each kbLoop In KeyBindings 
 If kbLoop.KeyCategory = wdKeyCategoryFont Then 
 Count = Count + 1 
 MsgBox kbLoop.Command & vbCr & kbLoop.KeyString 
 End If 
Next kbLoop 
 
If Count = 0 Then MsgBox "Keys haven't been assigned to fonts"

See Also

Concepts

KeyBinding Object Members

KeyBinding Object