none
Context menus from customized 2003 template RRS feed

  • Question

  • Greetings all,

    We have a template that was customized in Word 2003 and we now have opened and saved it in 2010. I've customized the ribbon using the CustomUI to add a custom tab and things on that tab and hide the "Add-Ins" tab. I now need to move on to the context menus.

    Working with the "Text" context menu I've been able to use the CustomUI to hide idMso things on the menu as such:

      <contextMenus>
        <contextMenu idMso="ContextMenuText"> 
          <button idMso="FontDialog" visible="false"/>
        </contextMenu>
      </contextMenus>
    

    but how do I get the id of the custom elements added by 2003 on the context menu so that I can reference them in the CustomUI XML?

    I know I can (an have) write VBA code that allows me to identify and manipulate those menus but I'd much rather have all my customization in one place, that being the CustomUI XML.

    Thanks!
    Ken

    Sunday, April 14, 2013 8:36 PM

Answers

  • Hi Ken

    You need to either remove these commandbar controls from the CommandBar (context menu) and incorporate them into your Ribbon XML, or you must continue to use your old VBA code to work with them. The two approaches can (still) exist side-by-side, but they can't work in-concert.


    Cindy Meister, VSTO/Word MVP, my blog

    Monday, April 15, 2013 3:09 PM
    Moderator
  • I see. I can write VBA code to remove them from the context menu altogether using the ".Delete" command then add them back into the Ribbon XML.

    Thanks again, Cindy

    Wednesday, April 17, 2013 12:19 PM

All replies

  • Hi Ken

    <<but how do I get the id of the custom elements added by 2003 on the context menu so that I can reference them in the CustomUI XML?>>

    Could you please be more specific about what these "custom elements" are?

    The Ribbon was specifically designed to allow a Ribbon XML to work only with those elements it defines, or elements it shares with another add-in, using a namespace and the idQ attribute. If these "custom elements" don't fall into that category, then you can only use VBA to manipulate them (and only as long as that interface is still supported by Office).


    Cindy Meister, VSTO/Word MVP, my blog

    Monday, April 15, 2013 8:04 AM
    Moderator
  • Thanks for answering Cindy!

    To the "Text" context menu in 2003 we added menu items (some with sub-menus) that either apply styles or run macros. Those are the guys I want to reference in the XML.

    Thanks again for taking the time,
    Ken

    Monday, April 15, 2013 1:55 PM
  • Hi Ken

    You need to either remove these commandbar controls from the CommandBar (context menu) and incorporate them into your Ribbon XML, or you must continue to use your old VBA code to work with them. The two approaches can (still) exist side-by-side, but they can't work in-concert.


    Cindy Meister, VSTO/Word MVP, my blog

    Monday, April 15, 2013 3:09 PM
    Moderator
  • I see. I can write VBA code to remove them from the context menu altogether using the ".Delete" command then add them back into the Ribbon XML.

    Thanks again, Cindy

    Wednesday, April 17, 2013 12:19 PM