Outlook Ribbon IDs
With VSTO 2005 SE it is simple to get a custom ribbon up and running in Outlook. After the initial F5 moment of success, one of the first things you probably need to do is implement some way of showing your custom ribbon only for certain types of Inspector windows rather than showing it in every type of Inspector window. In order to do this, add logic to the GetCustomUI method. Specifically, examine the ribbonID string passed to this method and return custom ribbon XML only if the ribbonID corresponds to the ribbon ID of the Inspector that you want to modify. For example, to display a custom ribbon only when reading or composing mail do something like this:
public
string GetCustomUI(string ribbonID)
{
string ui = null;
if (ribbonID == "Microsoft.Outlook.Mail.Read" || ribbonID == "Microsoft.Outlook.Mail.Compose")
ui = GetResourceText("OutlookRibbonExample.OutlookRibbon.xml");
return ui;
}
Here is a list of the Ribbon IDs used by Outlook:
- Microsoft.Outlook.Mail.Read
- Microsoft.Outlook.Mail.Compose
- Microsoft.Outlook.MeetingRequest.Read
- Microsoft.Outlook.MeetingRequest.Send
- Microsoft.Outlook.Appointment
- Microsoft.Outlook.Contact
- Microsoft.Outlook.Journal
- Microsoft.Outlook.Task
- Microsoft.Outlook.DistributionList
- Microsoft.Outlook.Report
- Microsoft.Outlook.Resend
- Microsoft.Outlook.Response.Read
- Microsoft.Outlook.Response.Compose
- Microsoft.Outlook.Response.CounterPropose
- Microsoft.Outlook.RSS
- Microsoft.Outlook.Post.Read
- Microsoft.Outlook.Post.Compose
- Microsoft.Outlook.Sharing.Read
- Microsoft.Outlook.Sharing.Compose
For more information check out the whitepaper "Customizing the Ribbon in Outlook 2007" on MSDN.