Outlook 2010 and 2013 context menu customization

Creating new context menu item is very similar to creating items in the Outlook Ribbons. It uses the same customUI XML. Definition of the XML which creates new item in the e-mail context menu may look like this.

<customui xmlns="http://schemas.microsoft.com/office/2009/07/customui">
  <contextmenus>
    <contextmenu idmso="ContextMenuMailItem">
      <menuseparator id="mniMailItemMenuSeparator">
      <button getenabled="GetMenuEnabled" getimage="GetImage" getlabel="GetLabel" id="mniImportMail" onaction="RibbonOnAction" tag="mniImportMail">
    </button></menuseparator></contextmenu>
  </contextmenus>
</customui>

The XML is quite self-explenatory. The only problem is where to find the correct idMso for a desired context menu. I did not find any list in the Microsoft documentation, but you can download the a plugin to Outlook which will display idMso as a context menu item on each context menu.

I also recommend to download XML schema for the Office 2010 Fluent User Interface, so that you have a list of all available tags and atributes of the customUI XML.