全部显示

KeyCategory 属性

       

返回分配给指定组合键的项目类型。WdKeyCategory,只读。

expression.KeyCategory

expression   必需。该表达式返回“应用于”列表中的一个对象。

示例

本示例显示分配给字体名称的按键。如果尚未给字体分配按键,则显示一条消息。

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"