共用方式為


Overview of the IRibbonUI Object

An add-in can use the IRibbonUI object to invalidate controls or menu items, and to update their content in the corresponding Microsoft Outlook user interface. The add-in specifies callback methods in the XML that IRibbonExtensibility.GetCustomUI returns. These callback methods handle events for custom controls or custom menu items. When Outlook calls one of these methods, it passes an IRibbonUI object as a parameter to the callback method. The IRibbonUI object is scoped so that the add-in can only invalidate its own controls or menu items that use the object. The add-in cannot invalidate the controls or menu items that another add-in created.

IRibbonUI exposes the following methods to customize the user interface in Outlook:

Method

Action

Description

Invalidate()

Callback

Marks all of the custom controls or menu items in your add-in for update.

InvalidateControl(string controlID)

Callback

Marks a specific control or menu item that is defined by a controlID in your add-in for update.

ActivateTab

Callback

Activates the specified custom tab on the Microsoft Office Fluent ribbon.

ActivateTabQ

Callback

Activates the specified custom tab on the ribbon by using the fully qualified name of the tab.

To minimize the impact on performance, use the InvalidateControl method instead of the Invalidate method unless you actually need to invalidate all the custom controls or menu items that your add-in defines. Calling Invalidate invalidates all controls and menu items that your add-in defines, and callbacks occur on open explorers, inspectors, and menus.

See Also

Concepts

Implementing the IRibbonExtensibility Interface

Office Fluent User Interface Extensibility for Outlook