Skip to content

Commit 4290c73

Browse files
author
github-actions
committed
Merge branch 'main' into live
2 parents 36e312a + fa94e91 commit 4290c73

20 files changed

+443
-60
lines changed

docs/develop/convert-xml-to-json-manifest.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Convert an add-in to use the unified manifest for Microsoft 365
33
description: Learn the various methods for converting an add-in with an add-in only manifest to the unified manifest for Microsoft 365 and sideload the add-in.
44
ms.topic: how-to
5-
ms.date: 04/18/2025
5+
ms.date: 04/22/2025
66
ms.localizationpriority: medium
77
---
88

@@ -127,9 +127,9 @@ The easiest way to convert is to use Teams Toolkit.
127127

128128
:::image type="content" source="../images/teams-toolkit-create-office-add-in.png" alt-text="The options in New Project dropdown menu. One option is called 'Office Add-in'.":::
129129

130-
1. The **App Features Using an Office Add-in** dropdown menu opens. The options listed will vary depending on your version of Teams Toolkit. Select **Import an Existing Office Add-in**.
130+
1. The **App Features Using an Office Add-in** dropdown menu opens. The options listed will vary depending on your version of Teams Toolkit. Select **Upgrade an Existing Office Add-in**.
131131

132-
:::image type="content" source="../images/teams-toolkit-create-office-import-capability.png" alt-text="The options in the App Features Using an Office Add-in dropdown menu. The 'Import an Existing Office Add-in' option is selected.":::
132+
:::image type="content" source="../images/teams-toolkit-create-office-import-capability.png" alt-text="The options in the App Features Using an Office Add-in dropdown menu. The 'Upgrade an Existing Office Add-in' option is selected.":::
133133

134134
1. In the **Existing add-in project folder** dropdown menu, browse to the root folder of the add-in project.
135135
1. In the **Select import project manifest file** dropdown menu, browse to the add-in only manifest file, typically named **manifest.xml**.

docs/develop/requirements-property-unified-manifest.md

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Specify Office Add-in requirements in the unified manifest for Microsoft 365
33
description: Learn how to use requirements to configure on which host and platforms an add-in can be installed and which features are available.
4-
ms.date: 02/12/2025
4+
ms.date: 04/18/2025
55
ms.topic: how-to
66
ms.localizationpriority: medium
77
---
@@ -53,6 +53,13 @@ The "requirements" properties in descendant objects of "extensions" are used to
5353
> [!TIP]
5454
> Don't include a capability, formFactor, or scope requirement in a descendant object of "extensions" that's *less* restrictive than the corresponding capability, formFactor, or scope requirement in the ancestor "extensions.requirements" property, if there is one. Since the add-in can't be installed on clients that don't meet the ancestor requirement, no feature filtering would occur anyway. For example, if an "extensions.requirements.capabilities" property requires **Mailbox 1.10**, there's no point in requiring **Mailbox 1.9** in any descendant objects.
5555
56+
> [!NOTE]
57+
> Office Add-ins that use the unified manifest for Microsoft 365 are *directly* supported in Office on the web, in [new Outlook on Windows](https://support.microsoft.com/office/656bb8d9-5a60-49b2-a98b-ba7822bc7627), and in Office on Windows connected to a Microsoft 365 subscription, Version 2304 (Build 16320.00000) or later.
58+
>
59+
> When the app package that contains the unified manifest is deployed in [AppSource](https://appsource.microsoft.com/) or the [Microsoft 365 Admin Center](/office/dev/add-ins/publish/publish) then an add-in only manifest is generated from the unified manifest and stored. This add-in only manifest enables the add-in to be installed on platforms that don't directly support the unified manifest, including Office on Mac, Office on mobile, subscription versions of Office on Windows earlier than 2304 (Build 16320.00000), and perpetual versions of Office on Windows.
60+
>
61+
> Feature filtering is less fine-grained in the add-in only manifest. As a result, on platforms that don't directly support the unified manifest, adding a "requirements" subproperty to *any* child of "extensions" is effectively the same as adding that same "requirements" subproperty to *all* the children of "extensions" with one possible exception. So, on these platforms *none* of the features that are configured in these child properties of "extensions" will be available on platform and version combinations that don't meet the specified requirements. The exception is the "extensions.alternates" property. If this property is present, the alternates feature will be filtered in or out based only on its own "requirements" subproperty (if any), not on the "requirements" subproperties of any other child properties of "extensions".
62+
5663
### extensions.alternates.requirements
5764

5865
The "extensions.alternates" property enables add-in developers to do the following:
@@ -61,14 +68,9 @@ The "extensions.alternates" property enables add-in developers to do the followi
6168
- Either hide or give preference to the version that uses the older technology.
6269
- Specify icons that are needed to make the unified manifest version of the add-in installable on Office versions that don't directly support the unified manifest.
6370

64-
> [!NOTE]
65-
> Office Add-ins that use the unified manifest for Microsoft 365 are *directly* supported in Office on the web, in [new Outlook on Windows](https://support.microsoft.com/office/656bb8d9-5a60-49b2-a98b-ba7822bc7627), and in Office on Windows connected to a Microsoft 365 subscription, Version 2304 (Build 16320.00000) or later.
66-
>
67-
> When the app package that contains the unified manifest is deployed in [AppSource](https://appsource.microsoft.com/) or the [Microsoft 365 Admin Center](/office/dev/add-ins/publish/publish) then an add-in only manifest is generated from the unified manifest and stored. This add-in only manifest enables the add-in to be installed on platforms that don't directly support the unified manifest, including Office on Mac, Office on mobile, subscription versions of Office on Windows earlier than 2304 (Build 16320.00000), and perpetual versions of Office on Windows.
68-
6971
For more information, see [Manage both a unified manifest and an add-in only manifest version of your Office Add-in](/office/dev/add-ins/concepts/duplicate-legacy-metaos-add-ins).
7072

71-
The "requirements" subproperty of "extensions.alternates" to selectively apply the "hide" or "prefer" subproperties only when certain requirements are met.
73+
Use the "requirements" subproperty of "extensions.alternates" to selectively apply the "hide" or "prefer" subproperties only when certain requirements are met.
7274

7375
For example, suppose that you want to hide (from the Office UI for installing add-ins) an older version of your add-in, but only in Office versions that support the **Mailbox 1.10** requirement set. You could do that with markup similar to the following:
7476

@@ -137,6 +139,10 @@ For example, suppose an Outlook add-in is configured to autolaunch in response t
137139
]
138140
```
139141

142+
### extensions.contentRuntimes.requirements
143+
144+
The "extensions.contentRuntimes" property can't be combined with any other child property of "extensions" (except "extensions.requirements"). This means that the content is the *only* feature of the add-in, so it makes no sense to filter out the feature's availability on some combinations of platform and Office version while allowing add-in to be installable on those same combinations. Accordingly, don't use the "requirements" property in "contentRuntimes". To control the installability of the content add-in, use the "extensions.requirements" property of the parent "extensions".
145+
140146
### extensions.contextMenus.requirements
141147

142148
The "extensions.contextMenus" property configures the add-in's context menus. A context menu is a shortcut menu that appears when you right-click (or select and hold) in the Office UI. The "requirements" subproperty can be used to allow context menus only when certain requirements are met.
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
---
2+
title: Work with formula value preview mode in your custom functions
3+
description: Work with formula value preview mode in your custom functions
4+
ms.date: 04/16/2025
5+
ms.localizationpriority: medium
6+
---
7+
8+
# Work with formula value preview mode in your custom functions (preview)
9+
10+
You can control how your custom function calculates results when participating in formula value preview mode. Formula value preview mode is a feature that allows end users to select portions of a formula while editing the cell to preview the values. This feature helps users evaluate the formula as they edit it. The following image shows an example of the user editing a formula and selecting the text `A1+A2`. The formula preview mode shows the value `7` above.
11+
12+
:::image type="content" source="../images/excel-formula-value-preview.png" alt-text="Screenshot of Excel formula editor with A1+A2 selected and a preview value of 7 displayed above the formula editor.":::
13+
14+
By default, custom functions (for example `=getHousePrice(A1)`) can be previewed by the user. However, the following list shows some scenarios in which you may want to control how your custom function participates in formula value preview mode.
15+
16+
- Your custom function calls one or more APIs that charge a rate for using them.
17+
- Your custom function accesses one or more scarce resources such as databases.
18+
- Your custom function takes significant time to calculate the result, and it wouldn’t be useful for a user during preview purposes.
19+
20+
You can change the behavior of your custom function to return a mock value instead. To do this use the `invocation.isInValuePreview` read-only property. The following code sample shows an example custom function named `getHousePrice` that looks up house prices through a monetized API. If `isInValuePreview` is `true`, the custom function returns a mock number to be used and avoids incurring any cost. If `isInValuePreview` is `false`, the custom function calls the API and returns the actual house price value for use in the Excel spreadsheet.
21+
22+
```javascript
23+
/**
24+
* Get the listing price for a house on the market for the given address.
25+
* @customfunction
26+
* @param address The address of the house.
27+
* @param invocation Custom function handler.
28+
* @returns The price of the house at the address.
29+
*/
30+
export function getHousePrice(address: string, invocation: CustomFunctions.Invocation): number {
31+
// Check if this call is for formula value preview mode.
32+
if (invocation.isInValuePreview) {
33+
// Avoid long-running expensive service calls.
34+
// Return a useable but fake number.
35+
return 450000;
36+
} else {
37+
// Make the actual service calls in this block.
38+
const price = callHouseServiceAPI(address);
39+
return price;
40+
}
41+
}
42+
```
43+
44+
## See also
45+
46+
- [Create custom functions in Excel](custom-functions-overview.md)

docs/excel/excel-add-ins-comments.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Work with comments using the Excel JavaScript API
33
description: Information on using the APIs to add, remove, and edit comments and comment threads.
4-
ms.date: 02/15/2022
4+
ms.date: 04/07/2025
55
ms.localizationpriority: medium
66
---
77

@@ -15,6 +15,9 @@ In the Excel JavaScript API, a comment includes both the single initial comment
1515

1616
Comments within a workbook are tracked by the `Workbook.comments` property. This includes comments created by users and also comments created by your add-in. The `Workbook.comments` property is a [CommentCollection](/javascript/api/excel/excel.commentcollection) object that contains a collection of [Comment](/javascript/api/excel/excel.comment) objects. Comments are also accessible at the [Worksheet](/javascript/api/excel/excel.worksheet) level. The samples in this article work with comments at the workbook level, but they can be easily modified to use the `Worksheet.comments` property.
1717

18+
> [!TIP]
19+
> To learn about adding and editing notes with the Excel JavaScript API, see [Work with notes using the Excel JavaScript API](excel-add-ins-notes.md).
20+
1821
## Add comments
1922

2023
Use the `CommentCollection.add` method to add comments to a workbook. This method takes up to three parameters:

docs/excel/excel-add-ins-notes.md

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
---
2+
title: Work with notes using the Excel JavaScript API
3+
description: Information on using the APIs to add, remove, and edit notes.
4+
ms.date: 04/04/2025
5+
ms.localizationpriority: medium
6+
---
7+
8+
# Work with notes using the Excel JavaScript API
9+
10+
This article describes how to add, change, and remove notes in a workbook with the Excel JavaScript API. You can learn more about notes from the [Insert comments and notes in Excel](https://support.microsoft.com/office/bdcc9f5d-38e2-45b4-9a92-0b2b5c7bf6f8) article. For information about the differences between notes and comments, see [The difference between threaded comments and notes](https://support.microsoft.com/office/the-difference-between-threaded-comments-and-notes-75a51eec-4092-42ab-abf8-7669077b7be3).
11+
12+
Notes are tied to an individual cell. Anyone viewing the workbook with sufficient permissions can view a note. Notes in a workbook are tracked by the `Workbook.notes` property. This includes notes created by users and also notes created by your add-in. The `Workbook.notes` property is a [NoteCollection](/javascript/api/excel/excel.notecollection) object that contains a collection of [Note](/javascript/api/excel/excel.note) objects. Notes are also accessible at the [Worksheet](/javascript/api/excel/excel.worksheet) level.
13+
14+
> [!TIP]
15+
> To learn about adding and editing comments with the Excel JavaScript API, see [Work with comments using the Excel JavaScript API](excel-add-ins-comments.md).
16+
17+
## Add a note
18+
19+
Use the `NoteCollection.add` method to add notes to a workbook. This method takes two parameters:
20+
21+
- `cellAddress`: The cell where the comment is added. This can either be a string or [Range](/javascript/api/excel/excel.range) object. The range must be a single cell.
22+
- `content`: The comment's content, as a string.
23+
24+
The following code sample shows how to add a note to the selected cell in a worksheet.
25+
26+
```js
27+
await Excel.run(async (context) => {
28+
// This function adds a note to the selected cell.
29+
const selectedRange = context.workbook.getSelectedRange();
30+
31+
// Note that an InvalidArgument error is thrown if multiple cells are selected.
32+
context.workbook.notes.add(selectedRange, "The first note.");
33+
await context.sync();
34+
});
35+
```
36+
37+
## Change note visibility
38+
39+
By default, the content of a note is hidden unless a user hovers over the cell with the note or sets the workbook to display notes. To display a note, use the [Note.visible](/javascript/api/excel/excel.note#excel-excel-note-visible-member) property. The following code sample shows how to change the visibility of a note.
40+
41+
```js
42+
await Excel.run(async (context) => {
43+
// This function sets the note on cell A1 to visible.
44+
const sheet = context.workbook.worksheets.getActiveWorksheet();
45+
const firstNote = sheet.notes.getItem("A1");
46+
47+
firstNote.load();
48+
await context.sync();
49+
50+
firstNote.visible = true;
51+
});
52+
```
53+
54+
## Edit the content of a note
55+
56+
To edit the content of a note, use the [Note.content](/javascript/api/excel/excel.note#excel-excel-note-content-member) property. The following sample shows how to change the content of the first note in the `NoteCollection`.
57+
58+
```js
59+
await Excel.run(async (context) => {
60+
// This function changes the content in the first note.
61+
const sheet = context.workbook.worksheets.getActiveWorksheet();
62+
const note = sheet.notes.getItemAt(0);
63+
64+
note.content = "Changing the content of the first note.";
65+
await context.sync();
66+
});
67+
```
68+
69+
> [!NOTE]
70+
> Use the `Note.authorName` property to get the author of a note. The author name is a read-only property.
71+
72+
## Change the size of a note
73+
74+
By default, notes are automatically sized to fit the content. To make notes larger or smaller, use the [Note.height](/javascript/api/excel/excel.note#excel-excel-note-height-member) and [Note.width](/javascript/api/excel/excel.note#excel-excel-note-width-member) properties.
75+
76+
The following sample shows how to set the size of the first note in the `NoteCollection`.
77+
78+
```js
79+
await Excel.run(async (context) => {
80+
// This function changes the height and width of the first note.
81+
const sheet = context.workbook.worksheets.getActiveWorksheet();
82+
const note = sheet.notes.getItemAt(0);
83+
84+
note.width = 400;
85+
note.height = 200;
86+
87+
await context.sync();
88+
});
89+
```
90+
91+
## Delete a note
92+
93+
To delete a note, use the [Note.delete](/javascript/api/excel/excel.note#excel-excel-note-delete-member(1)) method. The following sample shows how to delete the note attached to cell **A2**.
94+
95+
```js
96+
await Excel.run(async (context) => {
97+
// This function deletes the note from cell A2.
98+
const sheet = context.workbook.worksheets.getActiveWorksheet();
99+
const note = sheet.notes.getItem("A2");
100+
101+
note.delete();
102+
await context.sync();
103+
});
104+
```
105+
106+
## See also
107+
108+
- [Excel JavaScript object model in Office Add-ins](excel-add-ins-core-concepts.md)
109+
- [Work with workbooks using the Excel JavaScript API](excel-add-ins-workbooks.md)
110+
- [Work with comments using the Excel JavaScript API](excel-add-ins-comments.md)
111+
- [Insert comments and notes in Excel](https://support.microsoft.com/office/bdcc9f5d-38e2-45b4-9a92-0b2b5c7bf6f8)

0 commit comments

Comments
 (0)