|
1 |
| ---- |
| 1 | +--- |
2 | 2 | title: Create custom contextual tabs in Office Add-ins
|
3 | 3 | description: Learn how to add custom contextual tabs to your Office Add-in.
|
4 | 4 | ms.date: 06/30/2025
|
@@ -221,7 +221,7 @@ We'll construct an example of a contextual tabs JSON blob step-by-step. The full
|
221 | 221 |
|
222 | 222 | - Both the properties are required.
|
223 | 223 | - The `size` property unit of measure is pixels. Icons are always square, so the number is both the height and the width.
|
224 |
| - - The `sourceLocation` property specifies the full URL to the icon. Its value must match the URL specified in the **\<Image\>** element of the **\<Resources\>** section of your manifest (see [Specify the icons for your contextual tab](#specify-the-icons-for-your-contextual-tab)). |
| 224 | + - The `sourceLocation` property specifies the full URL to the icon. Its value must match the URL specified in the `<Image>` element of the `<Resources>` section of your manifest (see [Specify the icons for your contextual tab](#specify-the-icons-for-your-contextual-tab)). |
225 | 225 |
|
226 | 226 | > [!IMPORTANT]
|
227 | 227 | > Just as you typically must change the URLs in the add-in's manifest when you move from development to production, you must also change the URLs in your contextual tabs JSON.
|
@@ -720,7 +720,7 @@ When a parent menu control is marked with `"overriddenByRibbonApi": true`, then
|
720 | 720 |
|
721 | 721 | # [Add-in only manifest](#tab/xmlmanifest)
|
722 | 722 |
|
723 |
| -Begin by defining a custom core tab (that is, *noncontextual* custom tab) in the manifest that duplicates the ribbon customizations of the custom contextual tabs in your add-in. But add an [OverriddenByRibbonApi](/javascript/api/manifest/overriddenbyribbonapi) element as the first child element of the duplicate [Group](/javascript/api/manifest/group), [Control](/javascript/api/manifest/control), and menu **\<Item\>** elements on the custom core tabs. The effect of doing so is the following: |
| 723 | +Begin by defining a custom core tab (that is, *noncontextual* custom tab) in the manifest that duplicates the ribbon customizations of the custom contextual tabs in your add-in. But add an [OverriddenByRibbonApi](/javascript/api/manifest/overriddenbyribbonapi) element as the first child element of the duplicate [Group](/javascript/api/manifest/group), [Control](/javascript/api/manifest/control), and menu `<Item>` elements on the custom core tabs. The effect of doing so is the following: |
724 | 724 |
|
725 | 725 | - If the add-in runs on an application and platform that support custom contextual tabs, then the custom core groups and controls won't appear on the ribbon. Instead, the custom contextual tab will be created when the add-in calls the `requestCreateControls` method.
|
726 | 726 | - If the add-in runs on an application or platform that *doesn't* support `requestCreateControls`, then the elements do appear on the custom core tab.
|
@@ -751,10 +751,10 @@ The following is an example. Note that "MyButton" will appear on the custom core
|
751 | 751 |
|
752 | 752 | For more examples, see [OverriddenByRibbonApi](/javascript/api/manifest/overriddenbyribbonapi).
|
753 | 753 |
|
754 |
| -When a parent group, or menu is marked with `<OverriddenByRibbonApi>true</OverriddenByRibbonApi>`, then it isn't visible, and all of its child markup is ignored when custom contextual tabs aren't supported. So, it doesn't matter if any of those child elements have the **\<OverriddenByRibbonApi\>** element or what its value is. The implication of this is that if a menu item or control must be visible in all contexts, then not only should it not be marked with `<OverriddenByRibbonApi>true</OverriddenByRibbonApi>`, but *its ancestor menu and group must also not be marked this way*. |
| 754 | +When a parent group, or menu is marked with `<OverriddenByRibbonApi>true</OverriddenByRibbonApi>`, then it isn't visible, and all of its child markup is ignored when custom contextual tabs aren't supported. So, it doesn't matter if any of those child elements have the `<OverriddenByRibbonApi>` element or what its value is. The implication of this is that if a menu item or control must be visible in all contexts, then not only should it not be marked with `<OverriddenByRibbonApi>true</OverriddenByRibbonApi>`, but *its ancestor menu and group must also not be marked this way*. |
755 | 755 |
|
756 | 756 | > [!IMPORTANT]
|
757 |
| -> Don't mark *all* of the child elements of a group or menu with `<OverriddenByRibbonApi>true</OverriddenByRibbonApi>`. This is pointless if the parent element is marked with `<OverriddenByRibbonApi>true</OverriddenByRibbonApi>` for reasons given in the preceding paragraph. Moreover, if you leave out the **\<OverriddenByRibbonApi\>** on the parent (or set it to `false`), then the parent will appear regardless of whether custom contextual tabs are supported, but it will be empty when they are supported. So, if all the child elements shouldn't appear when custom contextual tabs are supported, mark the parent with `<OverriddenByRibbonApi>true</OverriddenByRibbonApi>`. |
| 757 | +> Don't mark *all* of the child elements of a group or menu with `<OverriddenByRibbonApi>true</OverriddenByRibbonApi>`. This is pointless if the parent element is marked with `<OverriddenByRibbonApi>true</OverriddenByRibbonApi>` for reasons given in the preceding paragraph. Moreover, if you leave out the `<OverriddenByRibbonApi>` on the parent (or set it to `false`), then the parent will appear regardless of whether custom contextual tabs are supported, but it will be empty when they are supported. So, if all the child elements shouldn't appear when custom contextual tabs are supported, mark the parent with `<OverriddenByRibbonApi>true</OverriddenByRibbonApi>`. |
758 | 758 |
|
759 | 759 | ---
|
760 | 760 |
|
|
0 commit comments