Results 1 to 6 of 6
  1. #1
    Bronze Lounger
    Join Date
    Jan 2001
    Location
    Melbourne, Australia
    Posts
    1,294
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Ive created a custom ribbon.
    http://msdn.microsoft.com/en-us/library/aa338202.aspx

    It appears Microsoft assigns default shortcut keys.
    When you hover your mouse over the icons & buttons the default shortcut keys
    display. eg C01, C02
    see screen capture

    Im going thru and assigning shorcut keys to the buttons using several methods
    customRibbon xml file
    code in the add-in

    The shortcut keys work.
    What I want to do is change the screen tips from microsofts default shortcuts to my custom shortcut keys.

    1. is there a way I can do this?

    in the xml file for labels you can set shortcuts using "amp:before the letter you want to assign as shortcut eg

    label="&Label"

    the shortcut key is "L"

    2. is there a way to set and display shortcut with multiple hotkeys eg "Alt+D"?



    many thanks

    diana
    Attached Images Attached Images

  2. #2
    Super Moderator
    Join Date
    Jan 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    3,852
    Thanks
    4
    Thanked 259 Times in 239 Posts
    Have you tried
    keytip="L"

    I would put info on the shortcuts into the screentip or supertip attributes eg.
    screentip="This button applies a style called xxxx" supertip="Press Alt-D to run this command from the keyboard"
    Andrew Lockton, Chrysalis Design, Melbourne Australia

  3. #3
    Bronze Lounger
    Join Date
    Jan 2001
    Location
    Melbourne, Australia
    Posts
    1,294
    Thanks
    0
    Thanked 0 Times in 0 Posts
    hi Andrew

    Ive placed shortcut keys in the screentips.

    when you press the Alt key displays the shortcut key tags
    eg
    Alt+ribbon key to activate the ribbon
    eg Alt+H = Home ribbon

    Therefore if i press Alt+C - to activate my custom ribbon
    Word displays the shortcut keys, and which Word sets default shortcut keys on my buttons. These I would like to change to make consistant with my shortcuts

    eg for buttonIconA my shortcut key and screen tip is "Alt+D"
    if I press Alt+C, (to activate my custom Ribbon ) for buttonIconA the Word default tip displays as "Y01"

    diana

  4. #4
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts
    Quote Originally Posted by Andrew Lockton View Post
    Have you tried
    keytip="L"
    Quote Originally Posted by Diana View Post
    if i press Alt+C - to activate my custom ribbon
    Word displays the shortcut keys, and which Word sets default shortcut keys on my buttons. These I would like to change to make consistant with my shortcuts
    Diana, I'm not sure you set the specific property Andrew suggested. Of course, it's also possible that Word is overriding your KeyTip (adding numerals) to avoid conflicts, as noted in Customizing the 2007 Office Fluent Ribbon for Developers (Part 3 of 3):

    How can I assign KeyTips to my controls?

    KeyTips are the keyboard shortcuts that appear on the Ribbon when you press the ALT key. You can assign your own KeyTips by using the keytip and getKeytip attributes. (The getKeytip attribute supplies the name of a callback procedure that provides the KeyTip.)

    [highlight='yellow']Note:
    If your KeyTips conflict with built-in controls or KeyTips from other add-ins, they might be assigned non-conflicting values automatically.[/highlight] KeyTips for groups, as a rule, should start with the letter "Z".

  5. #5
    Bronze Lounger
    Join Date
    Jan 2001
    Location
    Melbourne, Australia
    Posts
    1,294
    Thanks
    0
    Thanked 0 Times in 0 Posts
    yes i did use

    keytip="L"

    I need multiple keys eg
    Ctrl+Alt+1

    When I add these shortcut keys to the keytip, and recompile. I get an error message.

    perhaps I need to set using Words internal reference to the shortcut keys eg
    Application.BuildKeyCode(wdKeyControl, wdKeyAlt, wdKey1)

  6. #6
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts
    Quote Originally Posted by Diana View Post
    I need multiple keys eg
    Ctrl+Alt+1

    When I add these shortcut keys to the keytip, and recompile. I get an error message.

    perhaps I need to set using Words internal reference to the shortcut keys eg
    Application.BuildKeyCode(wdKeyControl, wdKeyAlt, wdKey1)
    Yes, that makes sense. The keyTip appears to be akin to an accelerator key on a menu, i.e., a plain character. BuildKeyCode sounds much more appropriate.

Posting Permissions

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