Outlook - Context Menu items in Outlook 2010

Asked By Nick Child on 04-Aug-10 10:59 AM
Hi

I'm trying to create a ribbon XML file to disable the right click menu items in Outlook 2010. I've read numerous posts and see various code examples of how to add new buttons but none on how to disable them.

My XML looks like this

<?xml version="1.0" encoding="UTF-8"?>
<customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui" onLoad="Ribbon_Load">
    <contextMenus>
    <contextMenu idMso="ContextMenuFolder">
     <button idMso="FolderPropertiesContext" getVisible="IsVisible" />
    </contextMenu>
    <contextMenu idMso="ContextMenuMailItem">
      <button id="MyContextMenuMailItem"
      label="My Label"
      onAction="OnMyButtonClick"/>
    </contextMenu>

   </contextMenus>
</customUI>

This successfully adds an item to the Right click menu called My Label. But what I actually want to do is disable a whole load of existing ones such as Delete and Junk and Move.  I do not know what the id's of these buttons are.

I have tried

<?xml version="1.0" encoding="UTF-8"?>
<customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui" onLoad="Ribbon_Load">
    <contextMenus>
    <contextMenu idMso="ContextMenuFolder">
     <button idMso="FolderPropertiesContext" getVisible="IsVisible" />
    </contextMenu>
    <contextMenu idMso="ContextMenuMailItem">
      <button id="MyContextMenuMailItem"
      label="Start Timer"
      onAction="OnMyButtonClick"/>
    </contextMenu>

    <contextMenu idMso="ContextMenuMailItem">
      <button id="Delete"
      enabled="False"
      visible="False"/>
    </contextMenu>

    </contextMenus>
</customUI>

this to hide the delete button but it does not work.  Where can I get a list of ID's for all these items .

regards
Nick

Addendum:  I have resolved this,  It appears if you go to the Options Menu in Outlook and then seelct Customise Ribbon it give you a list of items. Highlight the item you want and the tooltip shows the ID in brackets.  Also in the XML you need to specigy idMso not id for in built controls.

Anoop S replied to Nick Child on 04-Aug-10 11:39 AM
try with this code

<?xml version="1.0" encoding="UTF-8"?>
<customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui" onLoad="Ribbon_Load">
 <contextMenus>
  <contextMenu idMso="ContextMenuFolder">
   <button idMso="FolderPropertiesContext"
       enabled="false"
       visible="false"/>
  </contextMenu>
 </contextMenus>
</customUI>

http://social.msdn.microsoft.com/Forums/en-US/vsto/thread/2e60742b-28bd-4ef0-8487-98b41c73370f