KeyBinding.Disable Method
Word Developer Reference |
Removes the specified key combination if it is currently assigned to a command. After you use this method, the key combination has no effect.
Syntax
expression.Disable
expression Required. A variable that represents a KeyBinding object.
Remarks
Using this method is the equivalent to clicking the Remove button in the Customize Keyboard dialog box. Use the Clear method with a KeyBinding object to reset a built-in command to its default key assignment. You don't need to remove or rebind a KeyBinding object before adding it elsewhere.
Example
This example removes the CTRL+SHIFT+B key assignment. This key combination is assigned to the Bold command by default.
Visual Basic for Applications |
---|
|
This example assigns the CTRL+SHIFT+O key combination to the Organizer command. The example then uses the Disable method to remove the CTRL+SHIFT+O key combination and displays a message.
Visual Basic for Applications |
---|
|
This example removes all key assignments for the global macro named "Macro1."
Visual Basic for Applications |
---|
|
See Also