Microsoft Office Tutorials and References
In Depth Information
Email messages
The following image is a typical view of the category option available in
Outlook 2007:
Let's see in an example of how to get the category property by using the VSTO
objects for the mail items.
Open Visual Studio 2008 and create a new solution, as described 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)
{
// Creates a new mail item instance
Outlook.MailItem OLmailitems = (Outlook.MailItem)this.Application.
CreateItem(OlItemType.olMailItem);
// Get the category dialog window for the mail items
OLmailitems.ShowCategoriesDialog();
}
After executing this program, we can see the different color properties, as shown in
the following screenshot:
 
Search JabSto ::




Custom Search