PDA

View Full Version : Shortcut Keys on the Ribbon?



clhare
03-04-2013, 12:30 PM
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

Doug Robbins
03-04-2013, 09:32 PM
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.

Aflatoon
03-07-2013, 07:03 AM
I believe you just need to set its keytip attribute to the shortcut key you want.

clhare
03-07-2013, 08:04 AM
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).

Aflatoon
03-07-2013, 08:37 AM
<menu id="splitMenu" itemSize="large" keytip="Q">

for example

clhare
03-14-2013, 07:44 AM
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

Aflatoon
03-14-2013, 08:10 AM
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