Share via


Overview of the IRibbonControl Object

Outlook Developer Reference

The IRibbonControl object is passed in most of the callbacks available for Ribbon controls. This object is especially useful for Outlook developers because it provides a IRibbonControl.Context property that returns the Outlook Inspector that is about to be displayed.

IRibbonControl exposes the following properties.

Property Type Description
Context Object Returns an object that represents the window where the Ribbon is about to be displayed. Read-only.
Id String Returns a string that represents the id attribute for the control. Read-only.
Tag String Returns a string that represents the tag attribute for the control. Read-only.

If you are writing managed code, you should attempt to cast the object represented by IRibbonControl.Context to an Outlook Inspector object. If the cast succeeds, you can then compare the Inspector object returned by IRibbonControl.Context to other Inspector windows that are open. To determine the underlying item displayed in an Inspector window, you should examine Inspector.CurrentItem. Because CurrentItem is of type Object, your code will have to cast the object to an appropriate item type such as MailItem or ContactItem.