+ Reply to Thread
Results 1 to 4 of 4

How to remove commands like cut, copy, assign macro or ... from shape context menu

  1. #1
    Registered User
    Join Date
    06-02-2013
    Location
    iran
    MS-Off Ver
    excel 2010
    Posts
    11

    Question How to remove commands like cut, copy, assign macro or ... from shape context menu

    Hello to all.
    I'm urgently need answer for this, I can customize the context menu of shape with custom UI editor and .xml.
    you can see my attached workbook.
    But I want to remove other options from menu and additionally adding a built in function button too.
    at end in shape context menu only 2 item remain 1 for execute a macro and second to run built in function.
    thanks for your time.

    here is my xml
    it's work good but i can't do other part

    <customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui">
    <contextMenus>
    <contextMenu idMso="ContextMenuShape">

    <button id="MyButton" label="Excecure your macro"
    insertBeforeMso="Cut"
    onAction="a" />

    <menuSeparator id="MySeparator" insertBeforeMso="Cut" />
    </contextMenu>
    </contextMenus>
    </customUI>

    regards.
    B.sc of computer science
    hossein maleki
    Attached Files Attached Files

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,431

    Re: How to remove commands like cut, copy, assign macro or ... from shape context menu

    You need to make all the other controls invisible,

    this does the first few items in the menu.

    <customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui">
    <contextMenus>
    <contextMenu idMso="ContextMenuShape">

    <button idMso="Cut" visible="false" />
    <button idMso="Copy" visible="false" />
    <gallery idMso="PasteGalleryMini" visible="false" />

    <button id="MyButton" label="Excecure your macro"
    insertBeforeMso="Cut"
    onAction="a" />

    <menuSeparator id="MySeparator" insertBeforeMso="Cut" />
    </contextMenu>
    </contextMenus>
    </customUI>
    See here for resources on idMso values
    http://www.microsoft.com/en-us/downl...s.aspx?id=6627
    Cheers
    Andy
    www.andypope.info

  3. #3
    Registered User
    Join Date
    06-02-2013
    Location
    iran
    MS-Off Ver
    excel 2010
    Posts
    11

    Re: How to remove commands like cut, copy, assign macro or ... from shape context menu

    Hi Andy
    thank you for your Urgent help, I appreciate of your best answer.
    it's work good and solve my problem.
    But you don't answer about built in functions too, I should create another button and call a macro then in macro call built in functions too?
    Thanks again for your time

  4. #4
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,431

    Re: How to remove commands like cut, copy, assign macro or ... from shape context menu

    You do not mention exactly what built in function you want to use.
    If it is one that has an associated control then you would use it's idMso name to add it.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1