+ Reply to Thread
Results 1 to 2 of 2

How to add shortcut to custom menu entry?

  1. #1
    Benjamin
    Guest

    How to add shortcut to custom menu entry?

    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

  2. #2
    Benjamin
    Guest

    RE: How to add shortcut to custom menu entry?

    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 ;-)

    "Benjamin" wrote:

    > 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


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1