KeyCategory Property

WdKeyCategory

WdKeyCategory can be one of these WdKeyCategory constants.
wdKeyCategoryAutoText
wdKeyCategoryCommand
wdKeyCategoryDisable
wdKeyCategoryFont
wdKeyCategoryMacro
wdKeyCategoryNil
wdKeyCategoryPrefix
wdKeyCategoryStyle
wdKeyCategorySymbol

expression.KeyCategory

expression Required. An expression that returns one of the objects in the Applies To list.

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
Dim intCount As Integer

intCount = 0

For Each kbLoop In KeyBindings
    If kbLoop.KeyCategory = wdKeyCategoryFont Then
        intCount = intCount + 1
        MsgBox kbLoop.Command & vbCr & kbLoop.KeyString
    End If
Next kbLoop

If intCount = 0 Then _
    MsgBox "Keys haven't been assigned to fonts"

Applies to | KeyBinding Object | KeysBoundTo Collection Object

See Also | Command Property | KeyString Method