locked
How to hide all context menu buttons on picture RRS feed

  • Question

  • I develop an addin for Excel.

    I add customUI ribbon to customise picture context menu:

        <contextMenu idMso="ContextMenuPicture">
          <button idMso="Copy" visible="false"/>
          <button idMso="Cut" visible="false"/>
          <button idMso="HyperlinkEdit" visible="false"/>
          <button idMso="HyperlinkInsert" visible="false"/>
          <button idMso="HyperlinkOpenExcel" visible="false"/>
          <button idMso="HyperlinkRemove" visible="false"/>
          <button idMso="MacroAssign" visible="false"/>
          <button idMso="ObjectBringForward" visible="false"/>
          <button idMso="ObjectBringToFront" visible="false"/>
          <button idMso="ObjectBringToFront" visible="false"/>
          <button idMso="ObjectFormatDialog" visible="false"/>
          <button idMso="ObjectSendBackward" visible="false"/>
          <button idMso="ObjectSendToBack" visible="false"/>
          <button idMso="ObjectSendToBack" visible="false"/>
          <button idMso="ObjectsGroup" visible="false"/>
          <button idMso="ObjectSizeAndPropertiesDialog" visible="false"/>
          <button idMso="ObjectsRegroup" visible="false"/>
          <button idMso="ObjectsUngroup" visible="false"/>
          <button idMso="PictureChange" visible="false"/>
          <button idMso="PictureEdit" visible="false"/>
          <gallery idMso="PasteGalleryMini" visible="false"/>
          <menu idMso="ObjectsGroupMenu" visible="false"/>
          <splitButton idMso="ObjectSendToBackMenu" visible="false"/>
          <splitButton idMso="ObjectBringToFrontMenu" visible="false"/>
        </contextMenu>

    All context menus are invisible, but still have two button and a rotate button on picture like 

    How can I make them all invisible?

    • Moved by Chenchen Li Thursday, December 8, 2016 7:34 AM NOT Office Add-in
    Thursday, December 8, 2016 2:10 AM

Answers

  • Hi,

    I think it is impossible to hide the rest three.

    All the controls in the ContextMenuPicture are hidden using the XML you shared.

    The rest: Picture Crop / Picture Style and Rotate are not in the context menu ContextMenuPicture. I try to hide the controls in the Picture Tools, but it makes no difference.

    So, I think it is impossible to hide them since Office does not provide the idMso of them.

    Regards,

    Celeste


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Marked as answer by ChDw Thursday, December 8, 2016 9:58 AM
    Thursday, December 8, 2016 7:34 AM