From 3111f4d39aaa6723d3771200a4e595c63bcec9fe Mon Sep 17 00:00:00 2001 From: Sam Ramon <15154970+samantharamon@users.noreply.github.com> Date: Thu, 16 Jan 2025 18:04:16 -0800 Subject: [PATCH 1/2] Draft ContextMenu requirement set --- docs/manifest/extensionpoint.md | 4 +- docs/manifest/officemenu.md | 10 ++--- .../common/context-menu-requirement-sets.md | 37 +++++++++++++++++++ .../common/office-add-in-requirement-sets.md | 10 ++++- 4 files changed, 53 insertions(+), 8 deletions(-) create mode 100644 docs/requirement-sets/common/context-menu-requirement-sets.md diff --git a/docs/manifest/extensionpoint.md b/docs/manifest/extensionpoint.md index 8d19dd738c..f4298d9009 100644 --- a/docs/manifest/extensionpoint.md +++ b/docs/manifest/extensionpoint.md @@ -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 --- @@ -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 diff --git a/docs/manifest/officemenu.md b/docs/manifest/officemenu.md index b0fc52e38b..3aef1b4d18 100644 --- a/docs/manifest/officemenu.md +++ b/docs/manifest/officemenu.md @@ -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 --- @@ -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 diff --git a/docs/requirement-sets/common/context-menu-requirement-sets.md b/docs/requirement-sets/common/context-menu-requirement-sets.md new file mode 100644 index 0000000000..8dd7402caf --- /dev/null +++ b/docs/requirement-sets/common/context-menu-requirement-sets.md @@ -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 +--- + +# Ribbon 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 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
(Microsoft 365 subscription) | Office on Windows
(retail perpetual) | Office on Windows
(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) diff --git a/docs/requirement-sets/common/office-add-in-requirement-sets.md b/docs/requirement-sets/common/office-add-in-requirement-sets.md index 740e7abc84..a92fd6c520 100644 --- a/docs/requirement-sets/common/office-add-in-requirement-sets.md +++ b/docs/requirement-sets/common/office-add-in-requirement-sets.md @@ -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 --- @@ -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). | | + +--- + ### CustomXmlParts | Minimum Office application support | Methods in set | From 79631796a7195c87f8b960a2f46450e756d825d1 Mon Sep 17 00:00:00 2001 From: Sam Ramon <15154970+samantharamon@users.noreply.github.com> Date: Fri, 17 Jan 2025 10:31:58 -0800 Subject: [PATCH 2/2] Fix heading --- docs/requirement-sets/common/context-menu-requirement-sets.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/requirement-sets/common/context-menu-requirement-sets.md b/docs/requirement-sets/common/context-menu-requirement-sets.md index 8dd7402caf..4da176d156 100644 --- a/docs/requirement-sets/common/context-menu-requirement-sets.md +++ b/docs/requirement-sets/common/context-menu-requirement-sets.md @@ -6,7 +6,7 @@ ms.topic: overview ms.localizationpriority: medium --- -# Ribbon API requirement sets +# 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).