none
how to remove munu item from popup menu? RRS feed

  • Question

  • this forum can search serveral topic about add custom menu to popup menu, but i want to delete some menu from it, i don't know how to do it.

    for example, a simple document like below picture contains a RichTextContentControl, in right popup menu , we can see a object relatively "Remove Content Control" menu,  i want to remove it, has any idea?  thanks


    • Edited by sendreams Monday, March 10, 2014 1:50 PM
    Monday, March 10, 2014 1:48 PM

Answers

  • Hi sendreams,

    You could use the following xml to remove the button from the specified context menu.

    <customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui">
    	<contextMenus>
    		<contextMenu idMso="ContextMenuText">
    			<button idMso="ContentControlRemove" visible="false" />
    		</contextMenu>
    	</contextMenus>
    </customUI>

    For more information, please refer to:

    Office 2013 Help Files: Office Fluent User Interface Control Identifiers

    Customizing Context Menus in Office 2010


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    • Marked as answer by sendreams Wednesday, March 12, 2014 4:16 AM
    Tuesday, March 11, 2014 7:45 AM
    Moderator

All replies

  • aditional information:

    my envirement is:

    vs2013 sp1, office2013 64x, win8 ent

    thanks

    Monday, March 10, 2014 2:13 PM
  • Hi sendreams,

    You could use the following xml to remove the button from the specified context menu.

    <customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui">
    	<contextMenus>
    		<contextMenu idMso="ContextMenuText">
    			<button idMso="ContentControlRemove" visible="false" />
    		</contextMenu>
    	</contextMenus>
    </customUI>

    For more information, please refer to:

    Office 2013 Help Files: Office Fluent User Interface Control Identifiers

    Customizing Context Menus in Office 2010


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    • Marked as answer by sendreams Wednesday, March 12, 2014 4:16 AM
    Tuesday, March 11, 2014 7:45 AM
    Moderator
  • hi, jeffrey 

    thank you very much

    your method can work ok, but in my scenario, there has another question,

    1, my solution already has a custom ribbon, if use your way , other ribbon(KMRibbon) can not be load 

    diff type custom ribbon

    2, i want to let the menu hiding in my control, can do it? for example check the text content, if equals something then hidden it.

    thanks

    Tuesday, March 11, 2014 2:08 PM
  • i found a article tolk about this under outlook,,

    show-and-hide-context-menu-items-in-outlook-2010

    office will cache the ribbon control status automatic, in outlook, there is a FolderContextMenuDisplay event to Invalidate some control's cache, in word , i can not find any useful similar  event.



    Wednesday, March 12, 2014 2:54 AM
  •  void Application_WindowBeforeRightClick(Word.Selection Sel, ref bool Cancel) {
                this.RibbonUI.InvalidateControlMso("ContextMenuText");
            }

    but not work properly, 

    Wednesday, March 12, 2014 3:06 AM