Skip to content

Commit e302c28

Browse files
[WXP] Document Context Menu requirement set (#2182)
* Draft ContextMenu requirement set * Fix heading * Update requirement set name and platform availability * Update article title * Update ms.date and add version numbers
1 parent ef25045 commit e302c28

8 files changed

+74
-26
lines changed

docs/manifest/control-button.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ For more information, see [Version overrides in the add-in only manifest](/offic
5050

5151
## Examples
5252

53-
In the following example, the button executes a function. It's also configured to be disabled when the add-in launches. It can be programmatically enabled. For more information, see [Enable and Disable Add-in Commands](/office/dev/add-ins/design/disable-add-in-commands).
53+
In the following example, the button executes a function. It's also configured to be disabled when the add-in launches. It can be programmatically enabled. For more information, see [Change the availability of add-in commands](/office/dev/add-ins/design/disable-add-in-commands).
5454

5555
```xml
5656
<Control xsi:type="Button" id="Contoso.msgReadFunctionButton">

docs/manifest/enabled.md

+6-3
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
11
---
22
title: Enabled element in the manifest file
33
description: Learn how to specify that an Add-in Command is disabled when the add-in launches.
4-
ms.date: 03/12/2022
4+
ms.date: 03/11/2025
55
ms.localizationpriority: medium
66
---
77

88
# Enabled element
99

1010
Specifies whether a [Button control](control-button.md) or [Menu control](control-menu.md) is enabled when the add-in launches. The **\<Enabled\>** element is a child element of [Control](control.md). If it is omitted, the default is `true`.
1111

12+
> [!NOTE]
13+
> The **\<Enabled\>** element is only supported for controls on the ribbon. It isn't supported for controls added to the Office context menu.
14+
1215
**Add-in type:** Task pane
1316

1417
**Valid only in these VersionOverrides schemas**:
@@ -21,9 +24,9 @@ For more information, see [Version overrides in the add-in only manifest](/offic
2124

2225
- [RibbonApi 1.0](../requirement-sets/common/ribbon-api-requirement-sets.md)
2326

24-
This element is only valid in Excel, PowerPoint, and Word; that is, when the `Name` attribute of the [Host](host.md) element is "Workbook", "Presentation", or "Document".
27+
This element is only valid in **Excel**, **PowerPoint**, and **Word**; that is, when the `Name` attribute of the [Host](host.md) element is "Workbook", "Presentation", or "Document".
2528

26-
The parent control can also be programmatically enabled and disabled. For more information, see [Enable and Disable Add-in Commands](/office/dev/add-ins/design/disable-add-in-commands).
29+
The parent control can also be programmatically enabled and disabled. For more information, see [Change the availability of add-in commands](/office/dev/add-ins/design/disable-add-in-commands).
2730

2831
## Example
2932

docs/manifest/extensionpoint.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: ExtensionPoint element in the manifest file
33
description: Defines where an add-in exposes functionality in the Office UI.
4-
ms.date: 02/27/2025
4+
ms.date: 03/11/2025
55
ms.localizationpriority: medium
66
---
77

@@ -88,7 +88,7 @@ A context menu is a shortcut menu that appears when you right-click (or select a
8888

8989
#### Example
9090

91-
The following customizes the context menu opened on the selected text in a supported Office application. Note that the child control must be of type **Button**.
91+
The following customizes the context menu opened on the selected text in a supported Office application. The context menu control used is of type **Button**.
9292

9393
```xml
9494
<ExtensionPoint xsi:type="ContextMenu">

docs/manifest/officemenu.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: OfficeMenu element in the manifest file
33
description: The OfficeMenu element defines a collection of controls to be added to the Office context menu.
4-
ms.date: 08/13/2024
4+
ms.date: 03/11/2025
55
ms.localizationpriority: medium
66
---
77

@@ -34,15 +34,15 @@ Although its official data type is string, this attribute effectively functions
3434
- `ContextMenuText` - Displays the item on the context menu when text is selected and the user opens that menu (e.g., right-clicks) on the selected text. Applies to Word, Excel, PowerPoint, and OneNote.
3535
- `ContextMenuCell` - Displays the item on the context menu when the user opens that menu (e.g., right-clicks) on a cell on the spreadsheet. Applies to Excel.
3636

37-
3837
## Child elements
3938

40-
| Element | Required | Description |
39+
| Element | Required | Description |
4140
|:-----|:-----:|:-----|
42-
| [Control of type Button](control-button.md) | Yes | A single **Button** control object. |
41+
| [Control of type Button](control-button.md) | Yes | A single **Button** control object. |
42+
| [Control of type Menu](control-menu.md) | Yes | A single **Menu** control object. |
4343

4444
> [!NOTE]
45-
> There can be only one child control and it must be type **Button**.
45+
> There can be only one child control.
4646
4747
## Example
4848

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
---
2+
title: Context Menu API requirement sets
3+
description: Learn more about the Context Menu API requirement sets and the platforms it supports.
4+
ms.date: 03/11/2025
5+
ms.topic: overview
6+
ms.localizationpriority: medium
7+
---
8+
9+
# Context Menu API requirement sets
10+
11+
Requirement sets are named groups of API members. Office Add-ins use requirement sets specified in the manifest or use a runtime check to determine whether an Office application supports APIs that an add-in needs. For more information, see [Office versions and requirement sets](/office/dev/add-ins/develop/office-versions-and-requirement-sets).
12+
13+
Use the Context Menu API requirement set to configure the availability of custom items on a context menu in Office.
14+
15+
`ContextMenuApi 1.1` is supported in **Excel**, **PowerPoint**, and **Word**. The following table lists the minimum builds or versions for these applications, where applicable.
16+
17+
| Requirement set | Office on the web | Office on Windows<br>(Microsoft 365 subscription) | Office on Windows<br>(retail perpetual) | Office on Windows<br>(volume-licensed perpetual) | Office on Mac | Office on iOS | Outlook on Android |
18+
|:-----|:-----|:-----|:-----|:-----|:-----|:-----|:-----|
19+
| ContextMenuApi 1.1 | Supported | Version 2502 (Build 18526.20144) | Version 2502 (Build 18526.20144) | Not supported | Version 16.94 (25020927) | Not supported | Not supported |
20+
21+
To find out more about versions and build numbers, see:
22+
23+
[!INCLUDE [Links to get Office versions and how to find Office client version](../../includes/links-get-office-versions-builds.md)]
24+
25+
## Office Common API requirement sets
26+
27+
For information about Common API requirement sets, see [Office Common API requirement sets](office-add-in-requirement-sets.md).
28+
29+
## ContextMenuApi 1.1
30+
31+
To learn how to programmatically configure the availability of custom items on a context menu, see [Change the availability of add-in commands](/office/dev/add-ins/design/disable-add-in-commands). For details about the API, see [Office.ContextMenu](/javascript/api/office/office.contextmenu).
32+
33+
## See also
34+
35+
- [Office versions and requirement sets](/office/dev/add-ins/develop/office-versions-and-requirement-sets)
36+
- [Specify Office applications and API requirements](/office/dev/add-ins/develop/specify-office-hosts-and-api-requirements)
37+
- [Office Add-ins manifest](/office/dev/add-ins/develop/add-in-manifests)

docs/requirement-sets/common/office-add-in-requirement-sets.md

+9-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Office Common API requirement sets
33
description: Learn more about the Office Common API requirement sets.
4-
ms.date: 10/17/2024
4+
ms.date: 03/11/2025
55
ms.topic: overview
66
ms.localizationpriority: medium
77
---
@@ -56,6 +56,14 @@ See [Add-in command requirement sets](add-in-commands-requirement-sets.md).
5656

5757
---
5858

59+
### ContextMenuApi
60+
61+
| Minimum Office application support | Methods in set |
62+
|:-----|:-----|
63+
| See [Context Menu API requirement sets](context-menu-api-requirement-sets.md). | <ul><li>Office.contextMenu.requestUpdate</li></ul> |
64+
65+
---
66+
5967
### CustomXmlParts
6068

6169
| Minimum Office application support | Methods in set |

docs/requirement-sets/common/ribbon-api-requirement-sets.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ For information about Common API requirement sets, see [Office Common API requir
3131

3232
## Ribbon API 1.1
3333

34-
The Ribbon API 1.1 includes support for enabling and disabling Add-in Commands. To learn the patterns for this functionality, see [Enable and Disable Add-in Commands](/office/dev/add-ins/design/disable-add-in-commands). For details about the API, see the [Office.ribbon](/javascript/api/office/office.ribbon) reference topic.
34+
The Ribbon API 1.1 includes support for enabling and disabling Add-in Commands. To learn the patterns for this functionality, see [Change the availability of add-in commands](/office/dev/add-ins/design/disable-add-in-commands). For details about the API, see the [Office.ribbon](/javascript/api/office/office.ribbon) reference topic.
3535

3636
## Ribbon API 1.2
3737

0 commit comments

Comments
 (0)