Microsoft Office Tutorials and References
In Depth Information
Email messages
VSTO also supports the customization of Outlook 2007 context menu items. Let's
look at an example to add a custom menu item in the context menu item of the email
folder in Outlook.
Open Visual Studio 2008 and create a new solution, as explained earlier. Write
the following code to the context menu item in the mail box folder, inside the
ThisAddIn.cs file:
private void ThisAddIn_Startup(object sender, System.EventArgs e)
{
// Custom context menu item event managed
this.Application.ItemContextMenuDisplay += new Microsoft.Office.
Interop.Outlook.ApplicationEvents_11_
ItemContextMenuDisplayEventHandler(
PacktMenuItem_ItemContextMenuDisplay);
}
// Context menu item adding procedure
public void PacktMenuItem_ItemContextMenuDisplay(Microsoft.Office.
Core.CommandBar PacktCommandBar, Microsoft.Office.Interop.Outlook.
Selection Selection)
{
// Commadbarpopup control to context menu item
 
Search JabSto ::




Custom Search