Skip to content

Commit 2916434

Browse files
author
github-actions
committed
Merge branch 'main' into live
2 parents d1247b9 + 91cb342 commit 2916434

13 files changed

+314
-32
lines changed

docs/develop/office-javascript-api-object-model.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ The [CustomXmlParts](/javascript/api/office/office.customxmlparts) and [CustomXm
125125

126126
**Applies to:** Task pane add-ins for Word and PowerPoint
127127

128-
The [Document.getFileAsync](/javascript/api/office/office.document#office-office-document-getfileasync-member(1)) method and members of the [File](/javascript/api/office/office.file) and [Slice](/javascript/api/office/office.slice) objects to provide functionality for getting entire Word and PowerPoint document files in slices (chunks) of up to 4 MB at a time. For more information, see [Get the whole document from an add-in for PowerPoint or Word](../word/get-the-whole-document-from-an-add-in-for-word.md).
128+
The [Document.getFileAsync](/javascript/api/office/office.document#office-office-document-getfileasync-member(1)) method and members of the [File](/javascript/api/office/office.file) and [Slice](/javascript/api/office/office.slice) objects to provide functionality for getting entire Word and PowerPoint document files in slices (chunks) of up to 4 MB at a time. For more information, see [Get the whole document from an add-in for PowerPoint or Word](../develop/get-the-whole-document-from-an-add-in-for-powerpoint-or-word.md).
129129

130130
## Mailbox object
131131

docs/develop/support-for-task-pane-and-content-add-ins.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ If your task pane add-in runs in PowerPoint or Word, you can use the [Document.g
9090

9191
When you call `Document.getFileAsync` you get a copy of the document in a [File](/javascript/api/office/office.file) object. The `File` object provides access to the document in "chunks" represented as [Slice](/javascript/api/office/office.slice) objects. When you call `getFileAsync`, you can specify the file type (text or compressed Open Office XML format), and size of the slices (up to 4MB). To access the contents of the `File` object, you then call `File.getSliceAsync` which returns the raw data in the [Slice.data](/javascript/api/office/office.slice#office-office-slice-data-member) property. If you specified compressed format, you will get the file data as a byte array. If you are transmitting the file to a web service, you can transform the compressed raw data to a Base64-encoded string before submission. Finally, when you are finished getting slices of the file, use the `File.closeAsync` method to close the document.
9292

93-
For more details, see how to [get the whole document from an add-in for PowerPoint or Word](../word/get-the-whole-document-from-an-add-in-for-word.md).
93+
For more details, see how to [get the whole document from an add-in for PowerPoint or Word](../develop/get-the-whole-document-from-an-add-in-for-powerpoint-or-word.md).
9494

9595
## Read and write custom XML parts of a Word document
9696

1.62 KB
Loading
3.17 KB
Loading
5.35 KB
Loading

docs/images/outlook-notification.png

6.67 KB
Loading
1.5 KB
Loading

docs/outlook/notifications.md

Lines changed: 277 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,277 @@
1+
---
2+
title: Create notifications for your Outlook add-in
3+
description: Learn about the types of notification messages you can create for your Outlook add-in.
4+
ms.date: 05/29/2025
5+
ms.localizationpriority: medium
6+
---
7+
8+
# Create notifications for your Outlook add-in
9+
10+
Implement notification messages for your Outlook add-in to keep your users informed about important events, feedback, or errors with minimal disruption to their workflow.
11+
12+
> [!NOTE]
13+
> Support for the notifications API was introduced in Mailbox requirement set 1.3. Additional features were introduced in later requirement sets. To determine if your client supports these requirement sets, see [Outlook client support](/javascript/api/requirement-sets/outlook/outlook-api-requirement-sets#outlook-client-support).
14+
15+
## Supported Outlook surfaces and modes
16+
17+
Notification messages are supported on messages and appointments in both read and compose modes. They're displayed above the body of the mail item.
18+
19+
:::image type="content" source="../images/outlook-notification.png" alt-text="An insight notification displayed in an appointment in compose mode.":::
20+
21+
To manage a notification on a mail item, call [Office.context.mailbox.item.notificationMessages](/javascript/api/requirement-sets/outlook/requirement-set-1.3/office.context.mailbox.item#properties) in your add-in's JavaScript code. This property returns a [NotificationMessages](/javascript/api/outlook/office.notificationmessages) object with methods to add, remove, get, or replace notifications. The following code shows how to use these methods to manage your add-in's notifications.
22+
23+
```javascript
24+
const notificationMessages = Office.context.mailbox.item.notificationMessages;
25+
26+
// Sample informational message.
27+
const notificationDetails = {
28+
type: Office.MailboxEnums.ItemNotificationMessageType.InformationalMessage,
29+
message: "This is a sample notification message.",
30+
icon: "icon-16",
31+
persistent: false
32+
};
33+
34+
const notificationKey = "notification_01";
35+
36+
// Add a notification to the mail item.
37+
notificationMessages.addAsync(notificationKey, notificationDetails, (result) => {
38+
console.log("Added an informational notification.");
39+
});
40+
41+
// Get all the notifications of the mail item.
42+
notificationMessages.getAllAsync((result) => {
43+
console.log(JSON.stringify(result.value));
44+
});
45+
46+
// Replace a notification.
47+
const newNotification = {
48+
type: Office.MailboxEnums.ItemNotificationMessageType.ErrorMessage,
49+
message: "This is a sample error message."
50+
};
51+
52+
notificationMessages.replaceAsync(notificationKey, newNotification, (result) => {
53+
console.log("Replaced the existing notification.");
54+
});
55+
56+
// Remove a notification.
57+
notificationMessages.removeAsync(notificationKey, (result) => {
58+
console.log("Removed the notification.");
59+
});
60+
```
61+
62+
## Types of notifications
63+
64+
A notification consists of a unique identifier, an icon, and a message. Depending on the type, it could also include a **Dismiss** action or a custom action. There are different [types of notifications](/javascript/api/outlook/office.mailboxenums.itemnotificationmessagetype) you can display to the user to fit your particular scenario.
65+
66+
- [ErrorMessage](#errormessage)
67+
- [InformationalMessage](#informationalmessage)
68+
- [InsightMessage](#insightmessage)
69+
- [ProgressIndicator](#progressindicator)
70+
71+
The following sections describe each notification type, including its [properties](/javascript/api/outlook/office.notificationmessagedetails) and supported platforms.
72+
73+
### ErrorMessage
74+
75+
:::row:::
76+
:::column:::
77+
**Description**
78+
:::column-end:::
79+
:::column span="3":::
80+
Alerts the user about an error or failed operation. For example, use the `ErrorMessage` type to notify the user that their personalized signature wasn't successfully added to a message.
81+
82+
:::image type="content" source="../images/outlook-error-notification.png" alt-text="An error message notification.":::
83+
:::column-end:::
84+
:::row-end:::
85+
:::row:::
86+
:::column:::
87+
**Properties**
88+
:::column-end:::
89+
:::column span="3":::
90+
- Displays an error icon. This icon can't be customized.
91+
- Includes a **Dismiss** action to close the notification. If a user doesn't dismiss the error notification, it remains visible until the user sees it once before switching to another mail item.
92+
:::column-end:::
93+
:::row-end:::
94+
:::row:::
95+
:::column:::
96+
**Minimum supported requirement set**
97+
:::column-end:::
98+
:::column span="3":::
99+
[1.3](/javascript/api/requirement-sets/outlook/requirement-set-1.3/outlook-requirement-set-1.3)
100+
:::column-end:::
101+
:::row-end:::
102+
:::row:::
103+
:::column:::
104+
**Supported platforms**
105+
:::column-end:::
106+
:::column span="3":::
107+
- Web
108+
- Windows (new and classic)
109+
- Mac
110+
- Android
111+
- iOS
112+
:::column-end:::
113+
:::row-end:::
114+
115+
### InformationalMessage
116+
117+
:::row:::
118+
:::column:::
119+
**Description**
120+
:::column-end:::
121+
:::column span="3":::
122+
Provides information or feedback to the user. For example, use the `InformationalMessage` type to notify the user that their file upload completed successfully.
123+
124+
:::image type="content" source="../images/outlook-informational-notification.png" alt-text="An informational notification.":::
125+
:::column-end:::
126+
:::row-end:::
127+
:::row:::
128+
:::column:::
129+
**Properties**
130+
:::column-end:::
131+
:::column span="3":::
132+
- Must specify an icon. Although an icon is required, the custom icon is currently displayed only in classic Outlook on Windows. On other platforms, an information icon is shown.
133+
- Includes a **Dismiss** action to close the notification.
134+
- Can be customized to persist even after a user switches to another mail item. The notification remains until the add-in removes it or the user selects **Dismiss**.
135+
:::column-end:::
136+
:::row-end:::
137+
:::row:::
138+
:::column:::
139+
**Minimum supported requirement set**
140+
:::column-end:::
141+
:::column span="3":::
142+
[1.3](/javascript/api/requirement-sets/outlook/requirement-set-1.3/outlook-requirement-set-1.3)
143+
:::column-end:::
144+
:::row-end:::
145+
:::row:::
146+
:::column:::
147+
**Supported platforms**
148+
:::column-end:::
149+
:::column span="3":::
150+
- Web
151+
- Windows (new and classic)
152+
- Mac
153+
- Android
154+
- iOS
155+
:::column-end:::
156+
:::row-end:::
157+
158+
### InsightMessage
159+
160+
:::row:::
161+
:::column:::
162+
**Description**
163+
:::column-end:::
164+
:::column span="3":::
165+
Provides information or feedback to the user with an option to perform an action. For example, use the `InsightMessage` type to recommend adding catering services to a meeting with external recipients.
166+
167+
:::image type="content" source="../images/outlook-insight-notification.png" alt-text="An insight message notification.":::
168+
:::column-end:::
169+
:::row-end:::
170+
:::row:::
171+
:::column:::
172+
**Properties**
173+
:::column-end:::
174+
:::column span="3":::
175+
- Must specify an icon. Although an icon is required, the custom icon is displayed only in classic Outlook on Windows. On other platforms, an information icon is shown.
176+
- Includes an option to perform one [action](/javascript/api/outlook/office.notificationmessageaction). Currently, opening the add-in's task pane is the only supported action.
177+
- Includes a **Dismiss** action to close the notification.
178+
- Doesn't persist when a user switches to another mail item.
179+
:::column-end:::
180+
:::row-end:::
181+
:::row:::
182+
:::column:::
183+
**Minimum supported requirement set**
184+
:::column-end:::
185+
:::column span="3":::
186+
[1.10](/javascript/api/requirement-sets/outlook/requirement-set-1.10/outlook-requirement-set-1.10)
187+
:::column-end:::
188+
:::row-end:::
189+
:::row:::
190+
:::column:::
191+
**Supported platforms**
192+
:::column-end:::
193+
:::column span="3":::
194+
- Web
195+
- Windows (new and classic)
196+
- Mac
197+
:::column-end:::
198+
:::row-end:::
199+
200+
### ProgressIndicator
201+
202+
:::row:::
203+
:::column:::
204+
**Description**
205+
:::column-end:::
206+
:::column span="3":::
207+
Indicates the progress of an add-in operation. For example, use the `ProgressIndicator` to inform the user that their file is in the process of being attached to the mail item.
208+
209+
:::image type="content" source="../images/outlook-progress-notification.png" alt-text="A progress indicator notification.":::
210+
:::column-end:::
211+
:::row-end:::
212+
:::row:::
213+
:::column:::
214+
**Properties**
215+
:::column-end:::
216+
:::column span="3":::
217+
- In classic Outlook on Windows, displays a progress icon. On other platforms, displays an information icon. This icon can't be customized.
218+
- Doesn't persist when a user switches to another mail item.
219+
:::column-end:::
220+
:::row-end:::
221+
:::row:::
222+
:::column:::
223+
**Minimum supported requirement set**
224+
:::column-end:::
225+
:::column span="3":::
226+
[1.3](/javascript/api/requirement-sets/outlook/requirement-set-1.3/outlook-requirement-set-1.3)
227+
:::column-end:::
228+
:::row-end:::
229+
:::row:::
230+
:::column:::
231+
**Supported platforms**
232+
:::column-end:::
233+
:::column span="3":::
234+
- Web
235+
- Windows (new and classic)
236+
- Mac
237+
- Android
238+
- iOS
239+
:::column-end:::
240+
:::row-end:::
241+
242+
## Feature behaviors
243+
244+
When creating and managing notifications for your add-in, be mindful of the following behaviors, limitations, and best practices.
245+
246+
### Maximum number of notifications per mail item
247+
248+
In Outlook on the web, on Windows (new and classic), and on Mac, you can add a maximum of five notifications per message. In Outlook on mobile devices, only one notification can be added to a message. Setting an additional notification replaces the existing one.
249+
250+
### InsightMessage limitations
251+
252+
Only one `InsightMessage` notification is allowed per add-in on a mail item. In Outlook on the web and new Outlook on Windows, the `InsightMessage` type is only supported in compose mode.
253+
254+
### Notification icons and unified manifest for Microsoft 365
255+
256+
If your add-in uses the [unified manifest for Microsoft 365](../develop/unified-manifest-overview.md), you can't customize the icon of an `InformationalMessage` or `InsightMessage` notification. The notification uses the first image specified in the ["icons"](/microsoft-365/extensibility/schema/extension-common-custom-group-controls-item#icons) array of the first [extensions.ribbons.tabs.groups.controls](/microsoft-365/extensibility/schema/extension-common-custom-group-controls-item) object of the manifest. Although this is the case, you must still specify a string in the [icon](/javascript/api/outlook/office.notificationmessagedetails#outlook-office-notificationmessagedetails-icon-member) property of your [NotificationMessageDetails](/javascript/api/outlook/office.notificationmessagedetails) object (for example, "icon-16").
257+
258+
### Notification icons in Outlook on mobile devices
259+
260+
In compose mode, while the style of each notification type varies on other Outlook clients, notifications in Outlook on Android and on iOS all use the same style. The notification message always uses an information icon.
261+
262+
### Notifications for multiple selected messages
263+
264+
When managing notifications for multiple selected messages, only the `getAllAsync` method is supported. To learn more, see [Activate your Outlook add-in on multiple messages](item-multi-select.md).
265+
266+
### Best practices for ProgressIndicator notifications
267+
268+
When implementing a `ProgressIndicator` notification in your add-in, once the applicable operation or action completes, replace the progress notification with another notification type. This is a best practice to ensure that your users always get the latest status of an operation.
269+
270+
## Try the code example in Script Lab
271+
272+
Learn how you can use notifications in your add-in by trying out the [Work with notification messages](https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/outlook/35-notifications/add-getall-remove.yaml) sample in [Script Lab for Outlook](https://appsource.microsoft.com/product/office/wa200001603). For more information on Script Lab, see [Explore Office JavaScript API using Script Lab](../overview/explore-with-script-lab.md).
273+
274+
## See also
275+
276+
- [Use the Office dialog API in Office Add-ins](../develop/dialog-api-in-office-add-ins.md)
277+
- [Configure your Outlook add-in for event-based activation](autolaunch.md)

docs/reference/overview/powerpoint-add-ins-reference-overview.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: JavaScript API for PowerPoint
33
description: Overview of the PowerPoint JavaScript API.
4-
ms.date: 07/05/2019
4+
ms.date: 05/29/2025
55
ms.service: powerpoint
66
ms.localizationpriority: high
77
---
@@ -10,20 +10,20 @@ ms.localizationpriority: high
1010

1111
A PowerPoint add-in interacts with objects in PowerPoint by using the Office JavaScript API, which includes two JavaScript object models:
1212

13-
* **PowerPoint JavaScript API**: The [PowerPoint JavaScript API](/javascript/api/powerpoint) provides strongly-typed objects that you can use to access objects in PowerPoint.
13+
- **PowerPoint JavaScript API**: The [PowerPoint JavaScript API](/javascript/api/powerpoint) provides strongly-typed objects that you can use to access objects in PowerPoint. To learn about the asynchronous nature of the PowerPoint JavaScript APIs and how they work with the presentation, see [Using the application-specific API model](../../develop/application-specific-api-model.md).
1414

15-
* **Common APIs**: Introduced with Office 2013, the [Common API](/javascript/api/office) can be used to access features such as UI, dialogs, and client settings that are common across multiple types of Office applications.
15+
- **Common APIs**: The [Common API](/javascript/api/office) can be used to access features such as UI, dialogs, and client settings that are common across multiple Office applications. To learn more about using the Common API, see [Common JavaScript API object model](../../develop/office-javascript-api-object-model.md).
1616

1717
## Learn programming concepts
1818

1919
See [PowerPoint add-ins overview](../../powerpoint/powerpoint-add-ins.md) for information about important programming concepts.
2020

2121
## Learn about API capabilities
2222

23-
For hands-on experience using the Common API to interact with content in PowerPoint, complete the [PowerPoint add-in tutorial](../../tutorials/powerpoint-tutorial-yo.md).
24-
2523
For detailed information about the PowerPoint JavaScript API object model, see the [PowerPoint JavaScript API reference documentation](/javascript/api/powerpoint).
2624

25+
For hands-on experience interacting with content in PowerPoint, complete the [PowerPoint add-in tutorial](../../tutorials/powerpoint-tutorial-yo.md).
26+
2727
## Try out code samples in Script Lab
2828

2929
Use [Script Lab](../../overview/explore-with-script-lab.md) to get started quickly with a collection of built-in samples that show how to complete tasks with the API. You can run the samples in Script Lab to instantly see the result in the task pane or document, examine the samples to learn how the API works, and even use samples to prototype your own add-in.

docs/reference/overview/word-add-ins-reference-overview.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Word JavaScript API overview
33
description: Overview of the Word JavaScript API.
4-
ms.date: 02/24/2023
4+
ms.date: 05/29/2025
55
ms.topic: concept-article
66
ms.service: word
77
ms.localizationpriority: high
@@ -13,7 +13,7 @@ A Word add-in interacts with objects in Word by using the Office JavaScript API,
1313

1414
* **Word JavaScript API**: These are the [application-specific APIs](../../develop/application-specific-api-model.md) for Word. Introduced with Office 2016, the [Word JavaScript API](/javascript/api/word) provides strongly-typed objects that you can use to access objects and metadata in a Word document.
1515

16-
* **Common APIs**: Introduced with Office 2013, the [Common API](/javascript/api/office) can be used to access features such as UI, dialogs, and client settings that are common across multiple types of Office applications.
16+
* **Common APIs**: The [Common API](/javascript/api/office), introduced with Office 2013, can be used to access features such as UI, dialogs, and client settings that are common across multiple Office applications.
1717

1818
This section of the documentation focuses on the Word JavaScript API, which you'll use to develop the majority of functionality in add-ins that target Word on the web, or Word 2016 and later. For information about the Common API, see [Common JavaScript API object model](../../develop/office-javascript-api-object-model.md).
1919

@@ -23,7 +23,7 @@ See [Word JavaScript object model in Office Add-ins](../../word/word-add-ins-cor
2323

2424
## Learn about API capabilities
2525

26-
Use other articles in this section of the documentation to learn how to [get the whole document from an add-in](../../word/get-the-whole-document-from-an-add-in-for-word.md), [use search options in your Word add-in to find text](../../word/search-option-guidance.md), and more. See the table of contents for the complete list of available articles.
26+
Use other articles in this section of the documentation to learn how to [get the whole document from an add-in](../../develop/get-the-whole-document-from-an-add-in-for-powerpoint-or-word.md), [use search options in your Word add-in to find text](../../word/search-option-guidance.md), and more. See the table of contents for the complete list of available articles.
2727

2828
For hands-on experience using the Word JavaScript API to access objects in Word, complete the [Word add-in tutorial](../../tutorials/word-tutorial.md).
2929

0 commit comments

Comments
 (0)