Consulting

Results 1 to 7 of 7

Thread: Shortcut Keys on the Ribbon?

  1. #1
    VBAX Mentor clhare's Avatar
    Joined
    Mar 2005
    Posts
    470
    Location

    Shortcut Keys on the Ribbon?

    Hi all!

    I've found that I can add a shortcut key to a button by putting "&" in the button's label in the Custom UI Editor. Is it possible to add a shortcut key to the menu item as well (the parent of the button)? I haven't been able to find anything on that. Seems a bit of a waste to be able to use shortcuts on the buttons but not the menus...once I physically click on the menu item I want, I might as well click the button under it too instead of switching to the keyboard to select the button.

    Thanks!

    Cheryl

  2. #2
    VBAX Contributor
    Joined
    Oct 2012
    Location
    Brisbane, Queensland, Australia
    Posts
    163
    Location
    In Word at least, they seem to be assigned automatically in the format
    Y# where # is a sequential number starting at 1. The problem with that however is that it's a bit dynamic, particularly if you are using code to load or unload Add-ins.

    The UI Editor does not like the ampersand being used in the tab label in the way that you can add it to the button label.

  3. #3
    VBAX Master Aflatoon's Avatar
    Joined
    Sep 2009
    Location
    UK
    Posts
    1,720
    Location
    I believe you just need to set its keytip attribute to the shortcut key you want.
    Be as you wish to seem

  4. #4
    VBAX Mentor clhare's Avatar
    Joined
    Mar 2005
    Posts
    470
    Location
    I would greatly appreciate some sample code, because nothing I've tried to add a shortcut key to a menu item has worked (only the buttons worked).

  5. #5
    VBAX Master Aflatoon's Avatar
    Joined
    Sep 2009
    Location
    UK
    Posts
    1,720
    Location
    <menu id="splitMenu" itemSize="large" keytip="Q">

    for example
    Be as you wish to seem

  6. #6
    VBAX Mentor clhare's Avatar
    Joined
    Mar 2005
    Posts
    470
    Location
    Ah, thank you! I've used keytips for the tabs (though it took a few tries to find one that it will accept--I kept seeing Y1). I also used keytips for the menu items and the buttons. Again, some will work and others will have a YA, YB, etc., so it took awhile to find a combination that will work.

    Is there something that shows which keytips Word has already assigned? It's very frustrating!

    I haven't figured out how to actually use the shortcuts using &amp; yet. In Word 2003, I just use Alt+n. What do I do in Word 2010 to access these with just the keyboard?

    Thanks!

    Cheryl

  7. #7
    VBAX Master Aflatoon's Avatar
    Joined
    Sep 2009
    Location
    UK
    Posts
    1,720
    Location
    If you press Alt the keytips for the tabs appear, then press one of those to activate that tab and you'll see the tips for the controls
    Be as you wish to seem

Posting Permissions

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