none
Same callback appear more than 1 context menu RRS feed

  • Question

  • Hi,

    How to show the same callback in contextmenuText, contextmenuList, etc.?

    <customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui">
       <contextMenus>
          <contextMenu idMso="ContextMenuText">
              <button id="MyButton" label="My Button" insertBeforeMso="Cut" onAction="MyButtonMacro" />
           </contextMenu>
       </contextMenus>
    </customUI>

    I can only see MyButton in the plain text area. But I cannot see MyButton when I'm in the text with headings, list style or table.

    Thanks in advance.

    Thursday, January 31, 2013 6:31 AM

Answers

  • Hi SeekSol

    You have to use a <contextMenu> element set for every different context menu you want to affect. So, for example

    <customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui">
       <contextMenus>
          <contextMenu idMso="ContextMenuText">
              <button id="MyButton" label="My Button" insertBeforeMso="Cut" onAction="MyButtonMacro" />
           </contextMenu>
          <contextMenu idMso="ContextMenuList">
              <button id="MyButton" label="My Button" insertBeforeMso="Cut" onAction="MyButtonMacro" />
           </contextMenu>
       </contextMenus>
    < /customUI>


    Cindy Meister, VSTO/Word MVP, my blog

    • Marked as answer by SeekSol Thursday, January 31, 2013 2:30 PM
    Thursday, January 31, 2013 8:09 AM
    Moderator

All replies

  • Hi SeekSol

    You have to use a <contextMenu> element set for every different context menu you want to affect. So, for example

    <customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui">
       <contextMenus>
          <contextMenu idMso="ContextMenuText">
              <button id="MyButton" label="My Button" insertBeforeMso="Cut" onAction="MyButtonMacro" />
           </contextMenu>
          <contextMenu idMso="ContextMenuList">
              <button id="MyButton" label="My Button" insertBeforeMso="Cut" onAction="MyButtonMacro" />
           </contextMenu>
       </contextMenus>
    < /customUI>


    Cindy Meister, VSTO/Word MVP, my blog

    • Marked as answer by SeekSol Thursday, January 31, 2013 2:30 PM
    Thursday, January 31, 2013 8:09 AM
    Moderator
  • Thanks Cindy, it's worked.
    Thursday, January 31, 2013 2:29 PM