Propriedade KeyBinding.KeyCategory (Word)KeyBinding.KeyCategory property (Word)

Retorna o tipo do item atribuído ao acoplamento de teclas especificado.Returns the type of item assigned to the specified key binding. Somente leitura WdKeyCategory.Read-only WdKeyCategory.

SintaxeSyntax

expression.expression. KeyCategory

expression é obrigatório.expression Required. Uma variável que representa um objeto 'KeyBinding'.A variable that represents a 'KeyBinding' object.

ExemploExample

Este exemplo exibe as teclas atribuídas a nomes de fonte.This example displays the keys assigned to font names. Uma mensagem será exibida se nenhuma tecla tiver sido atribuída a fontes.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"

Ver tambémSee also

Objeto KeyBindingKeyBinding Object