Office.RibbonUpdaterData interface

Specifies changes to the ribbon, such as the enabled or disabled status of a button.

Remarks

Requirement set: RibbonAPI 1.1

Properties

tabs

Collection of tabs whose state is set with the call of requestUpdate.

Property Details

tabs

Collection of tabs whose state is set with the call of requestUpdate.

tabs: Tab[];

Property Value

Examples

// Office.Tab objects are properties of ribbon updater objects that are passed to the 
// Office.ribbon.requestUpdate method. The following shows how to set the visibility of 
// a custom contextual tab.

async function showDataTab() {
    await Office.ribbon.requestUpdate({
        tabs: [
            {
                id: "CtxTab1",
                visible: true
            }
        ]});
}

// The following does the same thing in TypeScript.

const showDataTab = async () => {
    const myContextualTab: Office.Tab = { id: "CtxTab1", visible: true };
    const ribbonUpdater: Office.RibbonUpdaterData = { tabs: [ myContextualTab ] };
    await Office.ribbon.requestUpdate(ribbonUpdater);
}