Edit

Bagikan melalui


IRibbonUI Interface

Definition

The object that is returned by the onLoad procedure specified on the customUI tag. The object contains methods for invalidating control properties and for refreshing the user interface.

public interface class IRibbonUI
[System.Runtime.InteropServices.Guid("000C03A7-0000-0000-C000-000000000046")]
public interface IRibbonUI
[<System.Runtime.InteropServices.Guid("000C03A7-0000-0000-C000-000000000046")>]
type IRibbonUI = interface
Public Interface IRibbonUI
Attributes

Examples

In the following example, starting the host application triggers the onLoad event procedure that then calls a procedure which creates a IRibbonUI object representing the Ribbon UI. Next, a callback procedure is defined that invalidates all of the cached controls and then refreshes the UI.

The following is the XML markup for Office to load the custom ribbon:

&lt;customUI … onLoad=”MyAddInInitialize” …&gt;

The following is the callback method for the onLoad event:

Dim MyRibbon As IRibbonUI
Sub MyAddInInitialize(Ribbon As IRibbonUI)
    Set MyRibbon = Ribbon
End Sub

Sub myFunction()
    ‘ Invalidates the caches of all of this add-in’s controls 
    MyRibbon.Invalidate()            
End Sub

Remarks

You can customize the Ribbon user interface (UI) by using callback procedures in COM add-ins. When the host application starts, the onLoad callback procedure is called. The callback procedure then returns a IRibbonUI object pointing to the user interface (UI). YOu can use that object to invoke the Invalidate, InvalidateControl, and Refresh methods.

Methods

ActivateTab(String)

Activates the specified custom tab.

ActivateTabMso(String)

Activates the specified built-in tab.

ActivateTabQ(String, String)

Activates the specified custom tab on the Microsoft Office Fluent Ribbon UI. Uses the fully qualified name of the tab which includes the identifier and the namespace of the tab.

Invalidate()

Invalidates the cached values for all of the controls of the Ribbon user interface.

InvalidateControl(String)

Invalidates the cached value for a single control on the Ribbon user interface.

InvalidateControlMso(String)

Used to invalidate a built-in control.

Applies to