Shortcut to a button on a toolbar

U

Ulf Nilsson

Hi,
How do I assign a shortcut to a button on a toolbar when the macro assigned
to the button is not to (and should not) be found under Tools - Customise...
- Keyboard... - Macros?

/ Ulf
 
U

Ulf Nilsson

I forgot to tell that the button is also in a menu. So it does not matter if
the shortcut is assigned to the button on the toolbar or in the menu.

/ Ulf
 
A

Anne P.

Choose Tools, Customize. Right-click the button or menu item to have a
shortcut assigned. Edit the name field and place an ampersand (&) to the
left of the letter that you want to be a shortcut. For example, you have a
button whose caption is Symbol. Place the amperand to the left of the S.
After you close out of Tools, Customize the S in Symbol will be underlined.
The user can then press Alt+S to access the button or menu item.

Anne P.
 
U

Ulf Nilsson

Thanks for your suggestion, but it only works when I choose to show text, and
not when only icons are shown, and I want the icon to be shown and not the
text.

Another problem is that the shortcut, for example Alt + J, can't be assigned
in that way because there is no letter J in the name.

I have to choose letters that Word is not using, and that limits the options.

Any more suggestion?

/ Ulf
 
J

Jean-Guy Marcil

Ulf Nilsson was telling us:
Ulf Nilsson nous racontait que :
Hi,
How do I assign a shortcut to a button on a toolbar when the macro
assigned to the button is not to (and should not) be found under
Tools - Customise... - Keyboard... - Macros?

Have you looked into keybindings?
--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site: http://www.word.mvps.org
 
U

Ulf Nilsson

How do I use keybindings when the macro is not to be found under Tools -
Customise... - Keyboard... - Macros?

/ Ulf
 
J

Jean-Guy Marcil

Ulf Nilsson was telling us:
Ulf Nilsson nous racontait que :
How do I use keybindings when the macro is not to be found under
Tools - Customise... - Keyboard... - Macros?

Try something like this:

CustomizationContext = NormalTemplate
KeyBindings.Add KeyCode:=BuildKeyCode(wdKeyAlt, _
wdKeyZ), KeyCategory:=wdKeyCategoryMacro, _
Command:="TestModule.Main"


This will assign the the ALT-Z shortcut to the Main macro in the TestModule.

--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site: http://www.word.mvps.org
 
U

Ulf Nilsson

Since I work with Office XP Dev and create dll, I cannot use any template to
attach any macro. Because of this, I do not think I can use KeyBindings.
Please correct me if I'm wrong.

I was thinking of another solution: If I press the following keys, I can
access my item: Alt + e, n, i

Is it possible to create such a macro in Normal.dot, that is NormalTemplate,
using my macro and call it MyMacro? Then I can use keyBindings?

Or can I set Alt + e, n, i instead of "TestModule.Main"?

/ Ulf
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top