How to set keytip on a ribbon?
Asked Answered
S

2

6

I set the value of my keytip attribute for a split button to be "CKS" but when I execute the add-on in Outlook 2010, I get the hint that it's accessible using "Y7". I'm guessing it's some default throw-in and an arbitrary number.

How do I force my choice of character combination to be the valid one on the ribbon?

Shona answered 8/10, 2012 at 1:46 Comment(7)
It might be my ignorance but I assumed that one couldn't affect the choice of the keys needed to be pressed to access a component. I thought it was a feature of the ribbon to assign mnemonics on its own.Indigoid
You can do it by using the keytip attribute in the customUI XML for the ribbon, but sometimes the Office programs decide to change it to Y1, Y2 etc, possibly because of a conflict with keytips for the built-in controls.Turpentine
@OlleSjögren Can that behavior be overriden? (Without being a MS employee dedicated to Office development, that is.)Shona
I don't think so. Compare your option CKS to the built-in tabs and controls - anyone else beginning with C?Turpentine
@OlleSjögren Actually not but I'm only working in Outlook. It's fully imaginable that other Office component is using it (or that MS wants that reserved for a certain usage or other reason). I wanted to start with "C" because I work at "CRM Konsulterna" and we're aiming at creating a product line accessible from the ribbon. It'd be neat to go "C+something" for each software piece we've released. Thanks!Shona
For the record, I tried a CKS keytip in Excel 2010 (I don't have Outlook) on both a tab and a button, and they both work perfectly... :)Turpentine
@OlleSjögren So I guess I was right - it's reserved for something. Well, good to know. Or do you mean that you have overriden the defaults of Office and enabled your own, customized "CKS" keytip?! If so, I'll be a bit worried why I can't. Also, put a short summary as an answer so you'll get some reputation. I know you want to... ;)Shona
O
13

You should be able to use your own shortcuts by using the keytip attribute in the customUI XML for the ribbon, but sometimes the Office programs decide to change it to Y1, Y2 etc., possibly because of a conflict with keytips for the built-in controls.

I don't have Outlook, but I tried the "CKS" keytip in Excel 2010, both on a tab and on a button, and it worked. Below is the XML used for the Excel ribbon:

<customUI onLoad="RibbonLoad" 
          xmlns="http://schemas.microsoft.com/office/2009/07/customui">
  <ribbon>
    <tabs>
      <tab id="tabTest" 
           label="Test" 
           keytip="CKS" >
        <group id="grpTest" 
               label="Group #1" >
          <button id="btn1" 
                  label="Button #1" 
                  size="large" 
                  keytip="CKS" />
        </group>
      </tab>
    </tabs>
  </ribbon>
</customUI>
Omen answered 11/10, 2012 at 9:12 Comment(1)
It's +1 for the quality but I'll wait for a while before grading you up in case you're aiming at Unsung here, hehe.Shona
B
0

I had this issue yesterday because there was another button with the same keytip. After changing the keytip, I could see my custom keytip properly

Beffrey answered 10/11, 2022 at 14:12 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.