KeysBoundTo CommandParameter 屬性(Word)KeysBoundTo.CommandParameter property (Word)

會傳回指派給指定的快速鍵命令參數。Returns the command parameter assigned to the specified shortcut key. 唯讀的字串Read-only String.


expressionexpression. CommandParameter

_運算式_代表 'KeysBoundTo' 物件的變數。expression A variable that represents a 'KeysBoundTo' object.


如需參數的命令的相關資訊,請參閱 Add 方法。For information about commands that take parameters, see the Add method. 使用 Command 屬性可傳回指派給指定的快速鍵的命令名稱。Use the Command property to return the command name assigned to the specified shortcut key.


本範例會使用命令參數 8,將快速鍵指定給 FontSize 命令。This example assigns a shortcut key to the FontSize command, with a command parameter of 8. 您可以使用 CommandParameter 屬性,來顯示命令參數以及命令名稱和代表鍵字串。Use the CommandParameter property to display the command parameter along with the command name and key string.

Dim kbNew As KeyBinding 
Set kbNew = KeyBindings.Add(KeyCategory:=wdKeyCategoryCommand, _ 
 Command:="FontSize", _ 
 KeyCode:=BuildKeyCode(wdKeyControl, wdKeyAlt, wdKeyS), _ 
MsgBox kbNew.Command & Chr$(32) & kbNew.CommandParameter _ 
 & vbCr & kbNew.KeyString

另請參閱See also

KeysBoundTo 集合物件KeysBoundTo Collection Object

支援和意見反應Support and feedback

有關於 Office VBA 或這份文件的問題或意見反應嗎?Have questions or feedback about Office VBA or this documentation? 如需取得支援服務並提供意見反應的相關指導,請參閱 Office VBA 支援與意見反應Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.