Office.Group interface
表示功能区选项卡上的一组控件。
要求集: RibbonApi 1.1
注解
示例
/**
* Shows or hides a contextual tab.
*/
async function setContextualTabVisibility(visible: boolean) {
// Define a tab group of controls.
const group: Office.Group = {
id: "TableToolsGroup",
controls: [
// The controls of the group...
],
};
// Update the ribbon to show or hide a tab with the specified group of controls.
await Office.ribbon.requestUpdate({
tabs: [
{
id: "contextTab1",
visible: visible,
groups: [group],
},
],
});
}
属性详细信息
controls
指定组中的一个或多个控件,例如菜单项、按钮等。
controls?: Control[];
属性值
注解
当对象Group是传递给 requestUpdateOffice.Ribbon 方法的 Office.RibbonUpdaterData对象的一部分时,controls各种 Office.Group 对象的属性指定哪些控件的启用状态已更改;controls该对象的父Tab对象的属性Group将被忽略。
id
清单中指定的组的标识符。
id: string;
属性值
string