KeyBinding.KeyCategory property (Word)
Returns the type of item assigned to the specified key binding. Read-only WdKeyCategory.
Syntax
expression. KeyCategory
expression Required. 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
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"
See also
Support and feedback
Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for