Show shortcuts in custom menus in Word

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi

I have created a new drop-down menu in Word next to the Help menu. I would
like to show the shortcuts that I have assigned to the functions in the
drop-down menu, is this possible?
If you open up the Files menu it will show the shortcuts assigned to a given
function, that's what I would like in my own drop-down menu.

I hope this makes some sense.
 
Yes, it is possible. You can add the shortcuts either via Customize or via VBA.

Customize:
Select Tools > Customize to open the Customize dialog box. Click the
"Commands" tab and make sure that "Save in" is set to the appropriate
template (e.g. Normal.dot). While the dialog box is open, click your menu and
for each command, right-click the command and add the shortcut in parenthesis
after the current name in the "Name" field - use spaces in front of the
shortcut as needed. If you want to underline a character (can be used as a
keyboard accelerator), add an "&" in front of the character. Close Customize
and save the template.

VBA:
A code line like the following will add the shortcut text "Ctrl+Shift+K" (or
change the existing shortcut text, if any) to the first command in the menu
"MyMenu" in the active Menu Bar:
CommandBars.ActiveMenuBar.Controls("MyMenu").Controls(1).ShortcutText =
"Ctrl+Shift+K"

Remember to save the template.

Note:
Before making changes to toolbars via VBA, it is important to set the
CustomizationContext to the template/document that you want to change. In
case of Normal.dot, add the following code line above the code:
CustomizationContext = NormalTemplate

Also note that adding the shortcut text to a command does not assign the
shortcut to the command. It only displays the text in the menu.

--
Regards
Lene Fredborg
DocTools - Denmark
www.thedoctools.com
Document automation - add-ins, macros and templates for Microsoft Word
 

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

Back
Top