How to add shortcut to custom menu entry?

G

Guest

I have a piece of VBA code that does the following: It adds to the Worksheet
Menu Bar a control of the type msoControlPopup (i.e. a new menu), and then it
adds to this new control a control of the type msoControlButton (i.e. a new
menu item).

With

Caption = "&New menu point"

I only have to press "N" once the menu is open. To add a direct shortcut, I
wrote

Application.OnKey "+^{N}", "ShowForm"

so I can execute ShowForm by pressing Ctrl+Shift+N. I'd like to have this
displayed next to the menu item, like e.g. in the File menu where it says
"Ctrl+N" next to the "New..." item. How can this be done? I didn't find a
property or anything to do the job.

Thanks in advance,

Benjamin
 
G

Guest

Never mind, I found a solution: If an OnAction macro is attached, there is a
property ShortcutText that does exactly what I was looking for. I should add
to my defence that help isn't installed on this system yet and I have to wait
for the admin to do so ;-)
 

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