how i can update lable of control using office js Office.RibbonUpdaterData interface please help me in this for ribbon button enable and disable this is working below code
async function updateButton(id, enabled, groupID) {
const button = { id, enabled };
const parentGroup = { id: groupID, controls: [button] };
const parentTab = { id: TAB_ID, groups: [parentGroup] };
const ribbonUpdater = { tabs: [parentTab] };
try {
await Office.ribbon.requestUpdate(ribbonUpdater);
console.log(`Button ${id} ${enabled ? "enabled" : "disabled"} in group ${groupID}.`);
} catch (error) {
console.error(`Error updating button ${id} in group ${groupID}: ${error}`);
}
}
but this is not working for update label. I will be glad if someone can help me with this.
i want update label of controls i mean ribbon button using office js.
There is no way to programmatically change the label of a custom control after the control has rendered for the first time on the ribbon. You can have two controls with different labels and configure them so that only one is enabled at any given time.