Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to use OnKey in MS Word?

1,020 views
Skip to first unread message

Stefan Mueller

unread,
Jan 17, 2001, 12:40:42 PM1/17/01
to
In Excel I use
Application.OnKey "^%b", "Macro_Call"

to call the macro Macro_Call by pressing Ctrl+Alt+B

Does someone know how to do the same in MS Word?

Any help is very appreciated
Stefan


Jay Freedman

unread,
Jan 17, 2001, 1:56:28 PM1/17/01
to
Hi, Stefan,

I don't know why the two applications are so different in this operation,
but the Word VBA equivalent would be

CustomizationContext = ActiveDocument.AttachedTemplate
KeyBindings.Add KeyCode:=BuildKeyCode(wdKeyB, wdKeyControl, wdKeyShift),
_
KeyCategory:=wdKeyCategoryMacro, Command:="Macro_Call"

There is also a dialog-based way to do this: go to Tools/Customize, click
the Keyboard button, select the Macros category, and select the name of the
macro to run. Then put the cursor in the "Press new shortcut key" box, press
Ctrl+Alt+B, and click Assign.

Regards,
Jay

"Stefan Mueller" <exch.m...@sulzer.ch> wrote in message
news:3A65D91A...@sulzer.ch...

0 new messages