Rebind Method Example

This example reassigns the CTRL+SHIFT+S key binding to the FileSaveAs command.

CustomizationContext = NormalTemplate
Set myKey = FindKey(BuildKeyCode(wdKeyControl, wdKeyShift, wdKeyS))
myKey.Rebind KeyCategory:=wdKeyCategoryCommand, _
    Command:="FileSaveAs"

This example rebinds all keys assigned to the macro named "Macro1" to the macro named "ReportMacro."

CustomizationContext = ActiveDocument.AttachedTemplate
For Each myKey In KeysBoundTo(KeyCategory:=wdKeyCategoryMacro, _
    Command:="Macro1")
    myKey.Rebind KeyCategory:=wdKeyCategoryMacro, _
        Command:="ReportMacro"
Next myKey