Command Property

Applies To

KeyBinding object, KeysBoundTo collection object.

Description

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

See Also

CommandParameter property, KeyCategory property, KeyString method, KeyString property.

Example

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

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