-
Notifications
You must be signed in to change notification settings - Fork 62
/
office.tab.yml
142 lines (120 loc) · 5.03 KB
/
office.tab.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
### YamlMime:TSType
name: Office.Tab
uid: 'office!Office.Tab:interface'
package: office!
fullName: Office.Tab
summary: >-
Represents an individual tab and the state it should have. For code examples, see [Enable and Disable Add-in
Commands](https://learn.microsoft.com/office/dev/add-ins/design/disable-add-in-commands) and [Create custom contextual
tabs](https://learn.microsoft.com/office/dev/add-ins/design/contextual-tabs)<!-- -->.
remarks: >-
**Requirement set**: [RibbonAPI
1.1](https://learn.microsoft.com/javascript/api/requirement-sets/common/ribbon-api-requirement-sets)
isPreview: false
isDeprecated: false
type: interface
properties:
- name: controls
uid: 'office!Office.Tab#controls:member'
package: office!
fullName: controls
summary: 'Specifies one or more of the controls in the tab, such as menu items, buttons, etc.'
remarks: >-
When the `Tab` object is part of an [Office.RibbonUpdaterData](xref:office!Office.RibbonUpdaterData:interface)
object passed to the `requestUpdate` method of [Office.Ribbon](xref:office!Office.Ribbon:interface)<!-- -->, this
property specifies the IDs of the controls whose enabled status is to be changed. However, if there is a `groups`
property on the tab, then this property is ignored and the `controls` properties of the specified groups must be
used to change enabled status.
isPreview: false
isDeprecated: false
syntax:
content: 'controls?: Control[];'
return:
type: '<xref uid="office!Office.Control:interface" />[]'
- name: groups
uid: 'office!Office.Tab#groups:member'
package: office!
fullName: groups
summary: Specifies one or more of the control groups on the tab.
remarks: >-
When the `Tab` object is part of an [Office.RibbonUpdaterData](xref:office!Office.RibbonUpdaterData:interface)
object passed to the `requestUpdate` method of [Office.Ribbon](xref:office!Office.Ribbon:interface)<!-- -->, the
`controls` properties of the various [Office.Group](xref:office!Office.Group:interface) objects specify which
controls have their enabled status changed; the `controls` property of the `Tab` object is ignored.
**Requirement set**: [RibbonAPI
1.1](https://learn.microsoft.com/javascript/api/requirement-sets/common/ribbon-api-requirement-sets)
isPreview: false
isDeprecated: false
syntax:
content: 'groups?: Group[];'
return:
type: '<xref uid="office!Office.Group:interface" />[]'
- name: id
uid: 'office!Office.Tab#id:member'
package: office!
fullName: id
summary: Identifier of the tab as specified in the manifest.
remarks: ''
isPreview: false
isDeprecated: false
syntax:
content: 'id: string;'
return:
type: string
description: |-
#### Examples
```TypeScript
// 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 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);
}
```
- name: visible
uid: 'office!Office.Tab#visible:member'
package: office!
fullName: visible
summary: Specifies whether the tab is visible on the ribbon. Used only with contextual tabs.
remarks: >-
**Requirement set**: [RibbonAPI
1.2](https://learn.microsoft.com/javascript/api/requirement-sets/common/ribbon-api-requirement-sets)
#### Examples
```TypeScript
// 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);
}
```
isPreview: false
isDeprecated: false
syntax:
content: 'visible?: boolean;'
return:
type: boolean