Object: BindingTables Collection
Adds a shortcut key assignment to the keybindings collection.
BindingTables.AddKeyBinding (ByVal KeySequence As String,
ByVal Command As String,
ByVal BindType As Variant,
ByVal KeyType As Variant,
ByVal UserData As Variant) As IKeyBinding
A string that represents the shortcut keys combination.
A string that represents the menu command or key-in command assigned to the shortcut keys.
A BindType constant that defines what command type the shortcut key is assigned to.
BindKeyType constant that defines the binding type of the shortcut keys.
(Optional) Reserved for future use.
IKeyBinding. The new KeyBinding Object.
' Get the document BindingTables object
Set docBindingTables = Gui.Bindings("Document")
' Assign shortcut keys Alt+F1 to Help->Contents->Automation
docBindingTables.AddKeyBinding "Alt+F1", "Help->Contents->Automation", BindMenu, BindAccelerator