Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WXP] Document Context Menu requirement set #2182

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/manifest/extensionpoint.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: ExtensionPoint element in the manifest file
description: Defines where an add-in exposes functionality in the Office UI.
ms.date: 09/05/2024
ms.date: 01/23/2025
ms.localizationpriority: medium
---

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

#### Example

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**.
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**.

```xml
<ExtensionPoint xsi:type="ContextMenu">
Expand Down
10 changes: 5 additions & 5 deletions docs/manifest/officemenu.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: OfficeMenu element in the manifest file
description: The OfficeMenu element defines a collection of controls to be added to the Office context menu.
ms.date: 08/13/2024
ms.date: 01/23/2025
ms.localizationpriority: medium
---

Expand Down Expand Up @@ -34,15 +34,15 @@ Although its official data type is string, this attribute effectively functions
- `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.
- `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.


## Child elements

| Element | Required | Description |
| Element | Required | Description |
|:-----|:-----:|:-----|
| [Control of type Button](control-button.md) | Yes | A single **Button** control object. |
| [Control of type Button](control-button.md) | Yes | A single **Button** control object. |
| [Control of type Menu](control-menu.md) | Yes | A single **Menu** control object. |

> [!NOTE]
> There can be only one child control and it must be type **Button**.
> There can be only one child control.

## Example

Expand Down
37 changes: 37 additions & 0 deletions docs/requirement-sets/common/context-menu-requirement-sets.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
title: Context Menu requirement sets
description: Learn more about the Context Menu API requirement sets and the platforms it supports.
ms.date: 01/23/2025
ms.topic: overview
ms.localizationpriority: medium
---

# Context Menu requirement sets

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).

Use the Context Menu requirement set to configure the availability of custom items on a context menu in Office.

The following table lists the Context Menu requirement sets, its supported Office client applications, and the minimum builds or versions for those applications, where applicable.

| 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 |
|:-----|:-----|:-----|:-----|:-----|:-----|:-----|:-----|
| ContextMenu 1.1 | Supported | TBD | TBD | Not supported | TBD | Not supported | Not supported |

To find out more about versions and build numbers, see:

[!INCLUDE [Links to get Office versions and how to find Office client version](../../includes/links-get-office-versions-builds.md)]

## Office Common API requirement sets

For information about Common API requirement sets, see [Office Common API requirement sets](office-add-in-requirement-sets.md).

## ContextMenu 1.1

To learn how to programmatically configure the availability of custom items on a context menu, see [Enable or disable 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).

## See also

- [Office versions and requirement sets](/office/dev/add-ins/develop/office-versions-and-requirement-sets)
- [Specify Office applications and API requirements](/office/dev/add-ins/develop/specify-office-hosts-and-api-requirements)
- [Office Add-ins manifest](/office/dev/add-ins/develop/add-in-manifests)
10 changes: 9 additions & 1 deletion docs/requirement-sets/common/office-add-in-requirement-sets.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: Office Common API requirement sets
description: Learn more about the Office Common API requirement sets.
ms.date: 10/17/2024
ms.date: 01/23/2025
ms.topic: overview
ms.localizationpriority: medium
---
Expand Down Expand Up @@ -56,6 +56,14 @@ See [Add-in command requirement sets](add-in-commands-requirement-sets.md).

---

### ContextMenu

| Minimum Office application support | Methods in set |
|:-----|:-----|
| See [Context Menu requirement sets](context-menu-requirement-sets.md). | <ul><li>Office.contextMenu.requestUpdate</li></ul> |

---

### CustomXmlParts

| Minimum Office application support | Methods in set |
Expand Down