Skip to content

Commit cb76614

Browse files
authored
[Excel] (ui) remove erroneous info about contextual tab limits (#5258)
1 parent 8dab865 commit cb76614

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

docs/design/contextual-tabs.md

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Create custom contextual tabs in Office Add-ins
33
description: Learn how to add custom contextual tabs to your Office Add-in.
4-
ms.date: 03/26/2025
4+
ms.date: 06/30/2025
55
ms.topic: how-to
66
ms.localizationpriority: medium
77
---
@@ -72,7 +72,7 @@ The following is an example.
7272
"tabs": [
7373
"groups": [
7474
{
75-
"id": "contextualTab",
75+
"id": "ContosoGroup",
7676
...
7777
"icons": [
7878
{
@@ -90,7 +90,7 @@ The following is an example.
9090
],
9191
"controls": [
9292
{
93-
"id": "contextualButton",
93+
"id": "WriteDataButton",
9494
...
9595
"icons": [
9696
{
@@ -141,15 +141,15 @@ The following is an example.
141141
---
142142

143143
> [!IMPORTANT]
144-
> When you move your add-in from development to production, remember to update the URLs in your manifest as needed (such as changing the domain from `localhost` to `contoso.com`).
144+
> When you move your add-in from development to staging or production, remember to update the URLs in your manifest as needed (such as changing the domain from `localhost` to `contoso.com`).
145145
146146
## Define the groups and controls that appear on the tab
147147

148148
Unlike custom core tabs, which are defined in the manifest, custom contextual tabs are defined at runtime with a JSON blob. Your code parses the blob into a JavaScript object, and then passes the object to the [Office.ribbon.requestCreateControls](/javascript/api/office/office.ribbon?view=common-js&preserve-view=true#office-office-ribbon-requestcreatecontrols-member(1)) method. Custom contextual tabs are only present in documents on which your add-in is currently running. This is different from custom core tabs which are added to the Office application ribbon when the add-in is installed and remain present when another document is opened. Also, the `requestCreateControls` method may be run only once in a session of your add-in. If it's called again, an error is thrown.
149149

150150
We'll construct an example of a contextual tabs JSON blob step-by-step. The full schema for the contextual tab JSON is at [dynamic-ribbon.schema.json](https://developer.microsoft.com/json-schemas/office-js/dynamic-ribbon.schema.json). If you're working in Visual Studio Code, you can use this file to get IntelliSense and to validate your JSON. For more information, see [Editing JSON with Visual Studio Code - JSON schemas and settings](https://code.visualstudio.com/docs/languages/json#_json-schemas-and-settings).
151151

152-
1. Begin by creating a JSON string with two array properties named `actions` and `tabs`. The `actions` array is a specification of all the functions that can be executed by controls on the contextual tab. The `tabs` array defines one or more contextual tabs, *up to a maximum of 20*.
152+
1. Begin by creating a JSON string with two array properties named `actions` and `tabs`. The `actions` array is a specification of all the functions that can be executed by controls on the contextual tab. The `tabs` array defines one or more contextual tabs.
153153

154154
```json
155155
'{
@@ -181,7 +181,7 @@ We'll construct an example of a contextual tabs JSON blob step-by-step. The full
181181

182182
- The `id` property is required. Use a brief, descriptive ID that is unique among all contextual tabs in your add-in.
183183
- The `label` property is required. It's a user-friendly string to serve as the label of the contextual tab.
184-
- The `groups` property is required. It defines the groups of controls that will appear on the tab. It must have at least one member *and no more than 20*. (There are also limits on the number of controls that you can have on a custom contextual tab and that will also constrain how many groups that you have. See the next step for more information.)
184+
- The `groups` property is required. It defines the groups of controls that will appear on the tab. It must have at least one member.
185185

186186
> [!NOTE]
187187
> The tab object can also have an optional `visible` property that specifies whether the tab is visible immediately when the add-in starts up. Since contextual tabs are normally hidden until a user event triggers their visibility (such as the user selecting an entity of some type in the document), the `visible` property defaults to `false` when not present. In a later section, we show how to set the property to `true` in response to an event.
@@ -204,9 +204,6 @@ We'll construct an example of a contextual tabs JSON blob step-by-step. The full
204204
- The `icon` property's value is an array of objects that specify the icons that the group will have on the ribbon depending on the size of the ribbon and the Office application window.
205205
- The `controls` property's value is an array of objects that specify the buttons and menus in the group. There must be at least one.
206206

207-
> [!IMPORTANT]
208-
> *The total number of controls on the whole tab can be no more than 20.* For example, you could have 3 groups with 6 controls each, and a fourth group with 2 controls, but you can't have 4 groups with 6 controls each.
209-
210207
```json
211208
{
212209
"id": "CustomGroup111",

0 commit comments

Comments
 (0)