Click here to Skip to main content
14,872,753 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

i try to build a context menu in Outlook 2013 with VS2012. But without any success.
In outlook 2010 I solved this problem with this code:

C#
this.Application.ItemContextMenuDisplay += new Outlook.ApplicationEvents_11_ItemContextMenuDisplayEventHandler(Application_ItemContextMenuDisplay);


But the Event "ItemContextMenuDisplay" does not exist any longer in outlook 2013.

How do I solve this problem in outlook 2013?

Thanks
Best Regards
WW
Posted

1 solution

Hi,

you will have to user Ribbons to create context menu on mail items. this will work on outlook 2010 and above version.

Ribbon1.xml is as below.


<customui xmlns="http://schemas.microsoft.com/office/2009/07/customui" onload="Ribbon_Load">

<contextmenus>
<contextmenu idmso="ContextMenuMailItem">

label="Upload Email"
tag="my Mail"
visible="true"
onAction="btnAction"/>




and add folowing code on addins.cs file

protected override Microsoft.Office.Core.IRibbonExtensibility CreateRibbonExtensibilityObject()
{

return new Ribbon1();

}
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900