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 4 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
2 changes: 1 addition & 1 deletion docs/manifest/control-button.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ For more information, see [Version overrides in the add-in only manifest](/offic

## Examples

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

```xml
<Control xsi:type="Button" id="Contoso.msgReadFunctionButton">
Expand Down
9 changes: 6 additions & 3 deletions docs/manifest/enabled.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
---
title: Enabled element in the manifest file
description: Learn how to specify that an Add-in Command is disabled when the add-in launches.
ms.date: 03/12/2022
ms.date: 01/23/2025
ms.localizationpriority: medium
---

# Enabled element

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

> [!NOTE]
> The **\<Enabled\>** element is only supported for controls on the ribbon. It isn't supported for controls added to the Office context menu.

**Add-in type:** Task pane

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

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

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

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

## Example

Expand Down
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-api-requirement-sets.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
title: Context Menu API 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 API 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 API requirement set to configure the availability of custom items on a context menu in Office.

`ContextMenuApi 1.1` is supported in **Excel**, **PowerPoint**, and **Word**. The following table lists the minimum builds or versions for these 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 |
|:-----|:-----|:-----|:-----|:-----|:-----|:-----|:-----|
| ContextMenuApi 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).

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

---

### ContextMenuApi

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

---

### CustomXmlParts

| Minimum Office application support | Methods in set |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ For information about Common API requirement sets, see [Office Common API requir

## Ribbon API 1.1

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

## Ribbon API 1.2

Expand Down
Loading