From b75e866ada2f21c3005c1911274d9e6c1e5e1da9 Mon Sep 17 00:00:00 2001 From: Elizabeth Samuel Date: Thu, 19 Dec 2019 12:54:51 -0800 Subject: [PATCH] [office-js] [office-js-preview] (Outlook) Reorganize members into modes (#41075) --- types/office-js-preview/index.d.ts | 1723 +++++++--------------------- types/office-js/index.d.ts | 1577 +++++++------------------ 2 files changed, 848 insertions(+), 2452 deletions(-) diff --git a/types/office-js-preview/index.d.ts b/types/office-js-preview/index.d.ts index a2dc677746..7b1e7e21a9 100644 --- a/types/office-js-preview/index.d.ts +++ b/types/office-js-preview/index.d.ts @@ -8860,6 +8860,12 @@ declare namespace Office { * **Important**: This is an internal Outlook object, not directly exposed through existing interfaces. * You should treat this as a mode of Office.context.mailbox.item. Refer to the * {@link https://docs.microsoft.com/office/dev/add-ins/reference/objectmodel/preview-requirement-set/office.context.mailbox.item | Object Model} page for more information. + * + * Child interfaces: + * + * - {@link Office.AppointmentCompose | AppointmentCompose} + * + * - {@link Office.AppointmentRead | AppointmentRead} */ interface Appointment extends Item { } @@ -8869,6 +8875,12 @@ declare namespace Office { * **Important**: This is an internal Outlook object, not directly exposed through existing interfaces. * You should treat this as a mode of Office.context.mailbox.item. Refer to the * {@link https://docs.microsoft.com/office/dev/add-ins/reference/objectmodel/preview-requirement-set/office.context.mailbox.item | Object Model} page for more information. + * + * Parent interfaces: + * + * - {@link Office.ItemCompose | ItemCompose} + * + * - {@link Office.Appointment | Appointment} */ interface AppointmentCompose extends Appointment, ItemCompose { /** @@ -9343,6 +9355,62 @@ declare namespace Office { * **{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}**: Appointment Organizer */ close(): void; + /** + * Gets an attachment from a message or appointment and returns it as an **AttachmentContent** object. + * + * The `getAttachmentContentAsync` method gets the attachment with the specified identifier from the item. As a best practice, you should use + * the identifier to retrieve an attachment in the same session that the attachmentIds were retrieved with the `getAttachmentsAsync` or + * `item.attachments` call. In Outlook on the web and mobile devices, the attachment identifier is valid only within the same session. + * A session is over when the user closes the app, or if the user starts composing an inline form then subsequently pops out the form to + * continue in a separate window. + * + * [Api set: Mailbox 1.8] + * + * @remarks + * + * **{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}**: ReadItem + * + * **{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}**: Appointment Organizer + * + * **Errors**: + * + * - InvalidAttachmentId: The attachment identifier does not exist. + * + * @param attachmentId - The identifier of the attachment you want to get. + * @param options - Optional. An object literal that contains one or more of the following properties. + * asyncContext: Developers can provide any object they wish to access in the callback method. + * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, + * asyncResult, which is an Office.AsyncResult object. If the call fails, the asyncResult.error property will contain and error code + * with the reason for the failure. + */ + getAttachmentContentAsync(attachmentId: string, options?: Office.AsyncContextOptions, callback?: (asyncResult: Office.AsyncResult) => void): void; + /** + * Gets an attachment from a message or appointment and returns it as an **AttachmentContent** object. + * + * The `getAttachmentContentAsync` method gets the attachment with the specified identifier from the item. As a best practice, you should use + * the identifier to retrieve an attachment in the same session that the attachmentIds were retrieved with the `getAttachmentsAsync` or + * `item.attachments` call. In Outlook on the web and mobile devices, the attachment identifier is valid only within the same session. + * A session is over when the user closes the app, or if the user starts composing an inline form then subsequently pops out the form to + * continue in a separate window. + * + * [Api set: Mailbox 1.8] + * + * @remarks + * + * **{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}**: ReadItem + * + * **{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}**: Appointment Organizer + * + * **Errors**: + * + * - InvalidAttachmentId: The attachment identifier does not exist. + * + * @param attachmentId - The identifier of the attachment you want to get. + * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, + * asyncResult, which is an Office.AsyncResult object. If the call fails, the asyncResult.error property will contain and error code + * with the reason for the failure. + */ + getAttachmentContentAsync(attachmentId: string, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Gets the item's attachments as an array. * @@ -9526,6 +9594,40 @@ declare namespace Office { * type Office.AsyncResult. */ getSelectedDataAsync(coercionType: Office.CoercionType | string, callback: (asyncResult: Office.AsyncResult) => void): void; + /** + * Gets the properties of an appointment or message in a shared folder, calendar, or mailbox. + * + * [Api set: Mailbox 1.8] + * + * @remarks + * + * **{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}**: ReadItem + * + * **{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}**: Appointment Organizer + * + * @param options - An object literal that contains one or more of the following properties. + * asyncContext: Developers can provide any object they wish to access in the callback method. + * @param callback - When the method completes, the function passed in the callback parameter is called with a single parameter of + * type Office.AsyncResult. + * The `value` property of the result is the properties of the shared item. + */ + getSharedPropertiesAsync(options: Office.AsyncContextOptions, callback: (asyncResult: Office.AsyncResult) => void): void; + /** + * Gets the properties of an appointment or message in a shared folder, calendar, or mailbox. + * + * [Api set: Mailbox 1.8] + * + * @remarks + * + * **{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}**: ReadItem + * + * **{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}**: Appointment Organizer + * + * @param callback - When the method completes, the function passed in the callback parameter is called with a single parameter of + * type Office.AsyncResult. + * The `value` property of the result is the properties of the shared item. + */ + getSharedPropertiesAsync(callback: (asyncResult: Office.AsyncResult) => void): void; /** * Asynchronously loads custom properties for this add-in on the selected item. * @@ -9951,6 +10053,12 @@ declare namespace Office { * **Important**: This is an internal Outlook object, not directly exposed through existing interfaces. * You should treat this as a mode of Office.context.mailbox.item. Refer to the * {@link https://docs.microsoft.com/office/dev/add-ins/reference/objectmodel/preview-requirement-set/office.context.mailbox.item | Object Model} page for more information. + * + * Parent interfaces: + * + * - {@link Office.ItemRead | ItemRead} + * + * - {@link Office.Appointment | Appointment} */ interface AppointmentRead extends Appointment, ItemRead { /** @@ -10347,6 +10455,62 @@ declare namespace Office { * asyncResult, which is an Office.AsyncResult object. */ displayReplyForm(formData: string | ReplyFormData, callback?: (asyncResult: Office.AsyncResult) => void): void; + /** + * Gets an attachment from a message or appointment and returns it as an **AttachmentContent** object. + * + * The `getAttachmentContentAsync` method gets the attachment with the specified identifier from the item. As a best practice, you should use + * the identifier to retrieve an attachment in the same session that the attachmentIds were retrieved with the `getAttachmentsAsync` or + * `item.attachments` call. In Outlook on the web and mobile devices, the attachment identifier is valid only within the same session. + * A session is over when the user closes the app, or if the user starts composing an inline form then subsequently pops out the form to + * continue in a separate window. + * + * [Api set: Mailbox 1.8] + * + * @remarks + * + * **{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}**: ReadItem + * + * **{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}**: Appointment Attendee + * + * **Errors**: + * + * - InvalidAttachmentId: The attachment identifier does not exist. + * + * @param attachmentId - The identifier of the attachment you want to get. + * @param options - Optional. An object literal that contains one or more of the following properties. + * asyncContext: Developers can provide any object they wish to access in the callback method. + * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, + * asyncResult, which is an Office.AsyncResult object. If the call fails, the asyncResult.error property will contain and error code + * with the reason for the failure. + */ + getAttachmentContentAsync(attachmentId: string, options?: Office.AsyncContextOptions, callback?: (asyncResult: Office.AsyncResult) => void): void; + /** + * Gets an attachment from a message or appointment and returns it as an **AttachmentContent** object. + * + * The `getAttachmentContentAsync` method gets the attachment with the specified identifier from the item. As a best practice, you should use + * the identifier to retrieve an attachment in the same session that the attachmentIds were retrieved with the `getAttachmentsAsync` or + * `item.attachments` call. In Outlook on the web and mobile devices, the attachment identifier is valid only within the same session. + * A session is over when the user closes the app, or if the user starts composing an inline form then subsequently pops out the form to + * continue in a separate window. + * + * [Api set: Mailbox 1.8] + * + * @remarks + * + * **{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}**: ReadItem + * + * **{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}**: Appointment Attendee + * + * **Errors**: + * + * - InvalidAttachmentId: The attachment identifier does not exist. + * + * @param attachmentId - The identifier of the attachment you want to get. + * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, + * asyncResult, which is an Office.AsyncResult object. If the call fails, the asyncResult.error property will contain and error code + * with the reason for the failure. + */ + getAttachmentContentAsync(attachmentId: string, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Gets initialization data passed when the add-in is {@link https://docs.microsoft.com/outlook/actionable-messages/invoke-add-in-from-actionable-message | activated by an actionable message}. * @@ -10588,6 +10752,40 @@ declare namespace Office { * **{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}**: Appointment Attendee */ getSelectedRegExMatches(): any; + /** + * Gets the properties of an appointment or message in a shared folder, calendar, or mailbox. + * + * [Api set: Mailbox 1.8] + * + * @remarks + * + * **{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}**: ReadItem + * + * **{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}**: Appointment Attendee + * + * @param options - An object literal that contains one or more of the following properties. + * asyncContext: Developers can provide any object they wish to access in the callback method. + * @param callback - When the method completes, the function passed in the callback parameter is called with a single parameter of + * type Office.AsyncResult. + * The `value` property of the result is the properties of the shared item. + */ + getSharedPropertiesAsync(options: Office.AsyncContextOptions, callback: (asyncResult: Office.AsyncResult) => void): void; + /** + * Gets the properties of an appointment or message in a shared folder, calendar, or mailbox. + * + * [Api set: Mailbox 1.8] + * + * @remarks + * + * **{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}**: ReadItem + * + * **{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}**: Appointment Attendee + * + * @param callback - When the method completes, the function passed in the callback parameter is called with a single parameter of + * type Office.AsyncResult. + * The `value` property of the result is the properties of the shared item. + */ + getSharedPropertiesAsync(callback: (asyncResult: Office.AsyncResult) => void): void; /** * Asynchronously loads custom properties for this add-in on the selected item. * @@ -11825,11 +12023,23 @@ declare namespace Office { * The item namespace is used to access the currently selected message, meeting request, or appointment. * You can determine the type of the item by using the `itemType` property. * - * If you want to see IntelliSense for only a specific type, cast this item to one of the following: + * If you want to see IntelliSense for only a specific type or mode, cast this item to one of the following: * - * {@link Office.ItemCompose | ItemCompose}, {@link Office.ItemRead | ItemRead}, - * {@link Office.MessageCompose | MessageCompose}, {@link Office.MessageRead | MessageRead}, - * {@link Office.AppointmentCompose | AppointmentCompose}, {@link Office.AppointmentRead | AppointmentRead} + * - {@link Office.Appointment | Appointment} + * + * - {@link Office.AppointmentCompose | AppointmentCompose} + * + * - {@link Office.AppointmentRead | AppointmentRead} + * + * - {@link Office.Message | Message} + * + * - {@link Office.MessageCompose | MessageCompose} + * + * - {@link Office.MessageRead | MessageRead} + * + * - {@link Office.ItemCompose | ItemCompose} + * + * - {@link Office.ItemRead | ItemRead} * * @remarks * @@ -11838,320 +12048,6 @@ declare namespace Office { * **{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}**: Compose or Read */ interface Item { - /** - * Gets an object that provides methods for manipulating the body of an item. - * - * [Api set: Mailbox 1.1] - * - * @remarks - * - * **{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}**: ReadItem - * - * **{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}**: Compose or Read - */ - body: Body; - /** - * Gets an object that provides methods for managing the item's categories. - * - * [Api set: Mailbox 1.8] - * - * @remarks - * - * **{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}**: ReadItem - * - * **{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}**: Compose or Read - */ - categories: Categories; - /** - * Gets the type of item that an instance represents. - * - * The itemType property returns one of the ItemType enumeration values, indicating whether the item object instance is a message or - * an appointment. - * - * @remarks - * - * **{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}**: ReadItem - * - * **{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}**: Compose or Read - */ - itemType: MailboxEnums.ItemType | string; - /** - * Gets the notification messages for an item. - * - * [Api set: Mailbox 1.3] - * - * @remarks - * - * **{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}**: ReadItem - * - * **{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}**: Compose or Read - */ - notificationMessages: NotificationMessages; - /** - * Gets the id of the series that an instance belongs to. - * - * In Outlook on the web and desktop clients, the seriesId returns the Exchange Web Services (EWS) ID of the parent (series) item that this item belongs to. - * However, on iOS and Android, the seriesId returns the REST ID of the parent item. - * - * **Note**: The identifier returned by the seriesId property is the same as the Exchange Web Services item identifier. - * The seriesId property is not identical to the Outlook IDs used by the Outlook REST API. - * Before making REST API calls using this value, it should be converted using Office.context.mailbox.convertToRestId. - * For more details, see {@link https://docs.microsoft.com/outlook/add-ins/use-rest-api | Use the Outlook REST APIs from an Outlook add-in}. - * - * The seriesId property returns null for items that do not have parent items such as single appointments, series items, or meeting requests - * and returns undefined for any other items that are not meeting requests. - * - * [Api set: Mailbox 1.7] - * - * @remarks - * - * **{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}**: ReadItem - * - * **{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}**: Compose or Read - */ - seriesId: string; - - /** - * Adds an event handler for a supported event. **Note**: Events are available only with task pane. - * - * To see which event types are supported, see `Office.EventType` for details. - * - * [Api set: Mailbox 1.7] - * - * @remarks - * - * **{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}**: ReadItem - * - * **{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}**: Compose or Read - * - * @param eventType - The event that should invoke the handler. - * @param handler - The function to handle the event. The function must accept a single parameter, which is an object literal. - * The type property on the parameter will match the eventType parameter passed to addHandlerAsync. - * @param options - Optional. An object literal that contains one or more of the following properties. - * asyncContext: Developers can provide any object they wish to access in the callback method. - * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, - * asyncResult, which is an Office.AsyncResult object. - */ - addHandlerAsync(eventType: Office.EventType | string, handler: any, options?: Office.AsyncContextOptions, callback?: (asyncResult: Office.AsyncResult) => void): void; - /** - * Adds an event handler for a supported event. **Note**: Events are available only with task pane. - * - * To see which event types are supported, see `Office.EventType` for details. - * - * [Api set: Mailbox 1.7] - * - * @remarks - * - * **{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}**: ReadItem - * - * **{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}**: Compose or Read - * - * @param eventType - The event that should invoke the handler. - * @param handler - The function to handle the event. The function must accept a single parameter, which is an object literal. - * The type property on the parameter will match the eventType parameter passed to addHandlerAsync. - * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, - * asyncResult, which is an Office.AsyncResult object. - */ - addHandlerAsync(eventType: Office.EventType | string, handler: any, callback?: (asyncResult: Office.AsyncResult) => void): void; - /** - * Gets an attachment from a message or appointment and returns it as an **AttachmentContent** object. - * - * The `getAttachmentContentAsync` method gets the attachment with the specified identifier from the item. As a best practice, you should use - * the identifier to retrieve an attachment in the same session that the attachmentIds were retrieved with the `getAttachmentsAsync` or - * `item.attachments` call. In Outlook on the web and mobile devices, the attachment identifier is valid only within the same session. - * A session is over when the user closes the app, or if the user starts composing an inline form then subsequently pops out the form to - * continue in a separate window. - * - * [Api set: Mailbox 1.8] - * - * @remarks - * - * **{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}**: ReadItem - * - * **{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}**: Compose or Read - * - * **Errors**: - * - * - InvalidAttachmentId: The attachment identifier does not exist. - * - * @param attachmentId - The identifier of the attachment you want to get. - * @param options - Optional. An object literal that contains one or more of the following properties. - * asyncContext: Developers can provide any object they wish to access in the callback method. - * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, - * asyncResult, which is an Office.AsyncResult object. If the call fails, the asyncResult.error property will contain and error code - * with the reason for the failure. - */ - getAttachmentContentAsync(attachmentId: string, options?: Office.AsyncContextOptions, callback?: (asyncResult: Office.AsyncResult) => void): void; - /** - * Gets an attachment from a message or appointment and returns it as an **AttachmentContent** object. - * - * The `getAttachmentContentAsync` method gets the attachment with the specified identifier from the item. As a best practice, you should use - * the identifier to retrieve an attachment in the same session that the attachmentIds were retrieved with the `getAttachmentsAsync` or - * `item.attachments` call. In Outlook on the web and mobile devices, the attachment identifier is valid only within the same session. - * A session is over when the user closes the app, or if the user starts composing an inline form then subsequently pops out the form to - * continue in a separate window. - * - * [Api set: Mailbox 1.8] - * - * @remarks - * - * **{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}**: ReadItem - * - * **{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}**: Compose or Read - * - * **Errors**: - * - * - InvalidAttachmentId: The attachment identifier does not exist. - * - * @param attachmentId - The identifier of the attachment you want to get. - * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, - * asyncResult, which is an Office.AsyncResult object. If the call fails, the asyncResult.error property will contain and error code - * with the reason for the failure. - */ - getAttachmentContentAsync(attachmentId: string, callback?: (asyncResult: Office.AsyncResult) => void): void; - /** - * Gets initialization data passed when the add-in is {@link https://docs.microsoft.com/outlook/actionable-messages/invoke-add-in-from-actionable-message | activated by an actionable message}. - * - * **Note**: This method is only supported by Outlook 2016 or later on Windows (Click-to-Run versions greater than 16.0.8413.1000) and Outlook on the web - * for Office 365. - * - * [Api set: Mailbox Preview] - * - * @remarks - * - * **{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}**: ReadItem - * - * **{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}**: Compose or Read - * - * @param options - Optional. An object literal that contains one or more of the following properties. - * asyncContext: Developers can provide any object they wish to access in the callback method. - * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, - * asyncResult, which is an Office.AsyncResult object. - * On success, the initialization data is provided in the asyncResult.value property as a string. - * If there is no initialization context, the asyncResult object will contain an Error object with its code property - * set to 9020 and its name property set to GenericResponseError. - * - * @beta - */ - getInitializationContextAsync(options?: Office.AsyncContextOptions, callback?: (asyncResult: Office.AsyncResult) => void): void; - /** - * Gets initialization data passed when the add-in is {@link https://docs.microsoft.com/outlook/actionable-messages/invoke-add-in-from-actionable-message | activated by an actionable message}. - * - * **Note**: This method is only supported by Outlook 2016 or later on Windows (Click-to-Run versions greater than 16.0.8413.1000) and Outlook on the web - * for Office 365. - * - * [Api set: Mailbox Preview] - * - * @remarks - * - * **{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}**: ReadItem - * - * **{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}**: Compose or Read - * - * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, - * asyncResult, which is an Office.AsyncResult object. - * On success, the initialization data is provided in the asyncResult.value property as a string. - * If there is no initialization context, the asyncResult object will contain an Error object with its code property - * set to 9020 and its name property set to GenericResponseError. - * - * @beta - */ - getInitializationContextAsync(callback?: (asyncResult: Office.AsyncResult) => void): void; - /** - * Gets the properties of an appointment or message in a shared folder, calendar, or mailbox. - * - * [Api set: Mailbox 1.8] - * - * @remarks - * - * **{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}**: ReadItem - * - * **{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}**: Compose or Read - * - * @param options - An object literal that contains one or more of the following properties. - * asyncContext: Developers can provide any object they wish to access in the callback method. - * @param callback - When the method completes, the function passed in the callback parameter is called with a single parameter of - * type Office.AsyncResult. - * The `value` property of the result is the properties of the shared item. - */ - getSharedPropertiesAsync(options: Office.AsyncContextOptions, callback: (asyncResult: Office.AsyncResult) => void): void; - /** - * Gets the properties of an appointment or message in a shared folder, calendar, or mailbox. - * - * [Api set: Mailbox 1.8] - * - * @remarks - * - * **{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}**: ReadItem - * - * **{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}**: Compose or Read - * - * @param callback - When the method completes, the function passed in the callback parameter is called with a single parameter of - * type Office.AsyncResult. - * The `value` property of the result is the properties of the shared item. - */ - getSharedPropertiesAsync(callback: (asyncResult: Office.AsyncResult) => void): void; - /** - * Asynchronously loads custom properties for this add-in on the selected item. - * - * Custom properties are stored as key/value pairs on a per-app, per-item basis. - * This method returns a CustomProperties object in the callback, which provides methods to access the custom properties specific to the - * current item and the current add-in. Custom properties are not encrypted on the item, so this should not be used as secure storage. - * - * The custom properties are provided as a CustomProperties object in the asyncResult.value property. - * This object can be used to get, set, and remove custom properties from the item and save changes to the custom property set back to - * the server. - * - * @remarks - * - * **{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}**: ReadItem - * - * **{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}**: Compose or Read - * - * @param callback - When the method completes, the function passed in the callback parameter is called with a single parameter of - * type Office.AsyncResult. - * @param userContext - Optional. Developers can provide any object they wish to access in the callback function. - * This object can be accessed by the asyncResult.asyncContext property in the callback function. - */ - loadCustomPropertiesAsync(callback: (asyncResult: Office.AsyncResult) => void, userContext?: any): void; - /** - * Removes the event handlers for a supported event type. **Note**: Events are available only with task pane. - * - * To see which event types are supported, see `Office.EventType` for details. - * - * [Api set: Mailbox 1.7] - * - * @remarks - * - * **{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}**: ReadItem - * - * **{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}**: Compose or Read - * - * @param eventType - The event that should revoke the handler. - * @param options - Optional. An object literal that contains one or more of the following properties. - * asyncContext: Developers can provide any object they wish to access in the callback method. - * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, - * asyncResult, which is an Office.AsyncResult object. - */ - removeHandlerAsync(eventType: Office.EventType | string, options?: Office.AsyncContextOptions, callback?: (asyncResult: Office.AsyncResult) => void): void; - /** - * Removes the event handlers for a supported event type. **Note**: Events are available only with task pane. - * - * To see which event types are supported, see `Office.EventType` for details. - * - * [Api set: Mailbox 1.7] - * - * @remarks - * - * **{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}**: ReadItem - * - * **{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}**: Compose or Read - * - * @param eventType - The event that should revoke the handler. - * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, - * asyncResult, which is an Office.AsyncResult object. - */ - removeHandlerAsync(eventType: Office.EventType | string, callback?: (asyncResult: Office.AsyncResult) => void): void; } /** * The compose mode of {@link Office.Item | Office.context.mailbox.item}. @@ -12159,582 +12055,14 @@ declare namespace Office { * **Important**: This is an internal Outlook object, not directly exposed through existing interfaces. * You should treat this as a mode of Office.context.mailbox.item. Refer to the * {@link https://docs.microsoft.com/office/dev/add-ins/reference/objectmodel/preview-requirement-set/office.context.mailbox.item | Object Model} page for more information. + * + * Child interfaces: + * + * - {@link Office.AppointmentCompose | AppointmentCompose} + * + * - {@link Office.MessageCompose | MessageCompose} */ interface ItemCompose extends Item { - /** - * Gets or sets the description that appears in the subject field of an item. - * - * The subject property gets or sets the entire subject of the item, as sent by the email server. - * - * The subject property returns a Subject object that provides methods to get and set the subject. - * - * @remarks - * - * **{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}**: ReadItem - * - * **{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}**: Compose - */ - subject: Subject; - - /** - * Adds a file to a message or appointment as an attachment. - * - * The addFileAttachmentAsync method uploads the file at the specified URI and attaches it to the item in the compose form. - * - * You can subsequently use the identifier with the removeAttachmentAsync method to remove the attachment in the same session. - * - * [Api set: Mailbox 1.1] - * - * @remarks - * - * **{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}**: ReadWriteItem - * - * **{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}**: Compose - * - * **Errors**: - * - * - AttachmentSizeExceeded: The attachment is larger than allowed. - * - * - FileTypeNotSupported: The attachment has an extension that is not allowed. - * - * - NumberOfAttachmentsExceeded: The message or appointment has too many attachments. - * - * @param uri - The URI that provides the location of the file to attach to the message or appointment. The maximum length is 2048 characters. - * @param attachmentName - The name of the attachment that is shown while the attachment is uploading. The maximum length is 255 characters. - * @param options - Optional. An object literal that contains one or more of the following properties. - * asyncContext: Developers can provide any object they wish to access in the callback method. - * isInline: If true, indicates that the attachment will be shown inline in the message body, and should not be displayed in the - * attachment list. - * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of - * type Office.AsyncResult. On success, the attachment identifier will be provided in the asyncResult.value property. - * If uploading the attachment fails, the asyncResult object will contain an Error object that provides a description of - * the error. - */ - addFileAttachmentAsync(uri: string, attachmentName: string, options?: Office.AsyncContextOptions & { isInline: boolean }, callback?: (asyncResult: Office.AsyncResult) => void): void; - /** - * Adds a file to a message or appointment as an attachment. - * - * The addFileAttachmentAsync method uploads the file at the specified URI and attaches it to the item in the compose form. - * - * You can subsequently use the identifier with the removeAttachmentAsync method to remove the attachment in the same session. - * - * [Api set: Mailbox 1.1] - * - * @remarks - * - * **{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}**: ReadWriteItem - * - * **{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}**: Compose - * - * **Errors**: - * - * - AttachmentSizeExceeded: The attachment is larger than allowed. - * - * - FileTypeNotSupported: The attachment has an extension that is not allowed. - * - * - NumberOfAttachmentsExceeded: The message or appointment has too many attachments. - * - * @param uri - The URI that provides the location of the file to attach to the message or appointment. The maximum length is 2048 characters. - * @param attachmentName - The name of the attachment that is shown while the attachment is uploading. The maximum length is 255 characters. - * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of - * type Office.AsyncResult. On success, the attachment identifier will be provided in the asyncResult.value property. - * If uploading the attachment fails, the asyncResult object will contain an Error object that provides a description of - * the error. - */ - addFileAttachmentAsync(uri: string, attachmentName: string, callback?: (asyncResult: Office.AsyncResult) => void): void; - /** - * Adds a file to a message or appointment as an attachment. - * - * The addFileAttachmentFromBase64Async method uploads the file from the base64 encoding and attaches it to the item in the compose form. - * This method returns the attachment identifier in the asyncResult.value object. - * - * You can subsequently use the identifier with the removeAttachmentAsync method to remove the attachment in the same session. - * - * **Note**: If you're using a data URL API (e.g., readAsDataURL), you need to strip out the data URL prefix then send the rest of the string to this API. - * For example, if the full string is represented by `data:image/svg+xml;base64,`, remove `data:image/svg+xml;base64,`. - * - * [Api set: Mailbox 1.8] - * - * @remarks - * - * **{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}**: ReadWriteItem - * - * **{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}**: Compose - * - * **Errors**: - * - * - AttachmentSizeExceeded: The attachment is larger than allowed. - * - * - FileTypeNotSupported: The attachment has an extension that is not allowed. - * - * - NumberOfAttachmentsExceeded: The message or appointment has too many attachments. - * - * @param base64File - The base64 encoded content of an image or file to be added to an email or event. - * @param attachmentName - The name of the attachment that is shown while the attachment is uploading. The maximum length is 255 characters. - * @param options - Optional. An object literal that contains one or more of the following properties. - * asyncContext: Developers can provide any object they wish to access in the callback method. - * isInline: If true, indicates that the attachment will be shown inline in the message body and should not be displayed in the attachment list. - * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type Office.AsyncResult. - * On success, the attachment identifier will be provided in the asyncResult.value property. - * If uploading the attachment fails, the asyncResult object will contain an Error object that provides a description of the error. - */ - addFileAttachmentFromBase64Async(base64File: string, attachmentName: string, options?: Office.AsyncContextOptions & { isInline: boolean }, callback?: (asyncResult: Office.AsyncResult) => void): void; - /** - * Adds a file to a message or appointment as an attachment. - * - * The addFileAttachmentFromBase64Async method uploads the file from the base64 encoding and attaches it to the item in the compose form. - * This method returns the attachment identifier in the asyncResult.value object. - * - * You can subsequently use the identifier with the removeAttachmentAsync method to remove the attachment in the same session. - * - * **Note**: If you're using a data URL API (e.g., readAsDataURL), you need to strip out the data URL prefix then send the rest of the string to this API. - * For example, if the full string is represented by `data:image/svg+xml;base64,`, remove `data:image/svg+xml;base64,`. - * - * [Api set: Mailbox 1.8] - * - * @remarks - * - * **{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}**: ReadWriteItem - * - * **{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}**: Compose - * - * **Errors**: - * - * - AttachmentSizeExceeded: The attachment is larger than allowed. - * - * - FileTypeNotSupported: The attachment has an extension that is not allowed. - * - * - NumberOfAttachmentsExceeded: The message or appointment has too many attachments. - * - * @param base64File - The base64 encoded content of an image or file to be added to an email or event. - * @param attachmentName - The name of the attachment that is shown while the attachment is uploading. The maximum length is 255 characters. - * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type Office.AsyncResult. - * On success, the attachment identifier will be provided in the asyncResult.value property. - * If uploading the attachment fails, the asyncResult object will contain an Error object that provides a description of the error. - */ - addFileAttachmentFromBase64Async(base64File: string, attachmentName: string, callback?: (asyncResult: Office.AsyncResult) => void): void; - /** - * Adds an Exchange item, such as a message, as an attachment to the message or appointment. - * - * The addItemAttachmentAsync method attaches the item with the specified Exchange identifier to the item in the compose form. - * If you specify a callback method, the method is called with one parameter, asyncResult, which contains either the attachment identifier or - * a code that indicates any error that occurred while attaching the item. You can use the options parameter to pass state information to the - * callback method, if needed. - * - * You can subsequently use the identifier with the removeAttachmentAsync method to remove the attachment in the same session. - * - * If your Office add-in is running in Outlook on the web, the addItemAttachmentAsync method can attach items to items other than the item that - * you are editing; however, this is not supported and is not recommended. - * - * [Api set: Mailbox 1.1] - * - * @remarks - * - * **{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}**: ReadWriteItem - * - * **{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}**: Compose - * - * **Errors**: - * - * - NumberOfAttachmentsExceeded: The message or appointment has too many attachments. - * - * @param itemId - The Exchange identifier of the item to attach. The maximum length is 100 characters. - * @param attachmentName - The name of the attachment that is shown while the attachment is uploading. The maximum length is 255 characters. - * @param options - Optional. An object literal that contains one or more of the following properties. - * asyncContext: Developers can provide any object they wish to access in the callback method. - * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of - * type Office.AsyncResult. On success, the attachment identifier will be provided in the asyncResult.value property. - * If adding the attachment fails, the asyncResult object will contain an Error object that provides a description of - * the error. - */ - addItemAttachmentAsync(itemId: any, attachmentName: string, options?: Office.AsyncContextOptions, callback?: (asyncResult: Office.AsyncResult) => void): void; - /** - * Adds an Exchange item, such as a message, as an attachment to the message or appointment. - * - * The addItemAttachmentAsync method attaches the item with the specified Exchange identifier to the item in the compose form. - * If you specify a callback method, the method is called with one parameter, asyncResult, which contains either the attachment identifier or - * a code that indicates any error that occurred while attaching the item. You can use the options parameter to pass state information to the - * callback method, if needed. - * - * You can subsequently use the identifier with the removeAttachmentAsync method to remove the attachment in the same session. - * - * If your Office add-in is running in Outlook on the web, the addItemAttachmentAsync method can attach items to items other than the item that - * you are editing; however, this is not supported and is not recommended. - * - * [Api set: Mailbox 1.1] - * - * @remarks - * - * **{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}**: ReadWriteItem - * - * **{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}**: Compose - * - * **Errors**: - * - * - NumberOfAttachmentsExceeded: The message or appointment has too many attachments. - * - * @param itemId - The Exchange identifier of the item to attach. The maximum length is 100 characters. - * @param attachmentName - The name of the attachment that is shown while the attachment is uploading. The maximum length is 255 characters. - * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of - * type Office.AsyncResult. On success, the attachment identifier will be provided in the asyncResult.value property. - * If adding the attachment fails, the asyncResult object will contain an Error object that provides a description of - * the error. - */ - addItemAttachmentAsync(itemId: any, attachmentName: string, callback?: (asyncResult: Office.AsyncResult) => void): void; - /** - * Closes the current item that is being composed - * - * The behaviors of the close method depends on the current state of the item being composed. - * If the item has unsaved changes, the client prompts the user to save, discard, or close the action. - * - * In the Outlook desktop client, if the message is an inline reply, the close method has no effect. - * - * **Note**: In Outlook on the web, if the item is an appointment and it has previously been saved using saveAsync, the user is prompted to save, - * discard, or cancel even if no changes have occurred since the item was last saved. - * - * [Api set: Mailbox 1.3] - * - * @remarks - * - * **{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}**: Restricted - * - * **{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}**: Compose - */ - close(): void; - /** - * Gets the item's attachments as an array. - * - * [Api set: Mailbox 1.8] - * - * @remarks - * - * **{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}**: ReadItem - * - * **{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}**: Compose - * - * @param options - Optional. An object literal that contains one or more of the following properties. - * asyncContext: Developers can provide any object they wish to access in the callback method. - * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of - * type Office.AsyncResult. If the call fails, the asyncResult.error property will contain and error code with the reason for - * the failure. - */ - getAttachmentsAsync(options?: Office.AsyncContextOptions, callback?: (asyncResult: Office.AsyncResult) => void): void; - /** - * Gets the item's attachments as an array. - * - * [Api set: Mailbox 1.8] - * - * @remarks - * - * **{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}**: ReadItem - * - * **{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}**: Compose - * - * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of - * type Office.AsyncResult. If the call fails, the asyncResult.error property will contain and error code with the reason for - * the failure. - */ - getAttachmentsAsync(callback?: (asyncResult: Office.AsyncResult) => void): void; - /** - * Gets initialization data passed when the add-in is activated by an actionable message. - * - * **Note**: This method is only supported by Outlook 2016 or later on Windows (Click-to-Run versions greater than 16.0.8413.1000) and Outlook on the web for Office 365. - * - * [Api set: Mailbox Preview] - * - * @remarks - * - * **{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}**: ReadItem - * - * **{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}**: Compose - * - * More information on {@link https://docs.microsoft.com/outlook/actionable-messages/invoke-add-in-from-actionable-message | actionable messages}. - * - * @param options - Optional. An object literal that contains one or more of the following properties. - * asyncContext: Developers can provide any object they wish to access in the callback method. - * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of - * type Office.AsyncResult. - * On success, the initialization data is provided in the asyncResult.value property as a string. - * If there is no initialization context, the asyncResult object will contain an Error object with its code property - * set to 9020 and its name property set to GenericResponseError. - * - * @beta - */ - getInitializationContextAsync(options?: Office.AsyncContextOptions, callback?: (asyncResult: Office.AsyncResult) => void): void; - /** - * Gets initialization data passed when the add-in is activated by an actionable message. - * - * **Note**: This method is only supported by Outlook 2016 or later on Windows (Click-to-Run versions greater than 16.0.8413.1000) and Outlook on the web for Office 365. - * - * [Api set: Mailbox Preview] - * - * @remarks - * - * **{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}**: ReadItem - * - * **{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}**: Compose - * - * - * More information on {@link https://docs.microsoft.com/outlook/actionable-messages/invoke-add-in-from-actionable-message | actionable messages}. - * - * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of - * type Office.AsyncResult. - * On success, the initialization data is provided in the asyncResult.value property as a string. - * If there is no initialization context, the asyncResult object will contain an Error object with its code property - * set to 9020 and its name property set to GenericResponseError. - * - * @beta - */ - getInitializationContextAsync(callback?: (asyncResult: Office.AsyncResult) => void): void; - /** - * Asynchronously returns selected data from the subject or body of a message. - * - * If there is no selection but the cursor is in the body or subject, the method returns an empty string for the selected data. - * If a field other than the body or subject is selected, the method returns the InvalidSelection error. - * - * To access the selected data from the callback method, call asyncResult.value.data. - * To access the source property that the selection comes from, call asyncResult.value.sourceProperty, which will be either body or subject. - * - * [Api set: Mailbox 1.2] - * - * @returns - * The selected data as a string with format determined by coercionType. - * - * @remarks - * - * **{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}**: ReadItem - * - * **{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}**: Compose - * - * @param coercionType - Requests a format for the data. If Text, the method returns the plain text as a string, removing any HTML tags present. - * If HTML, the method returns the selected text, whether it is plaintext or HTML. - * @param options - An object literal that contains one or more of the following properties. - * asyncContext: Developers can provide any object they wish to access in the callback method. - * @param callback - When the method completes, the function passed in the callback parameter is called with a single parameter of - * type Office.AsyncResult. - */ - getSelectedDataAsync(coercionType: Office.CoercionType | string, options: Office.AsyncContextOptions, callback: (asyncResult: Office.AsyncResult) => void): void; - /** - * Asynchronously returns selected data from the subject or body of a message. - * - * If there is no selection but the cursor is in the body or subject, the method returns an empty string for the selected data. - * If a field other than the body or subject is selected, the method returns the InvalidSelection error. - * - * To access the selected data from the callback method, call asyncResult.value.data. - * To access the source property that the selection comes from, call asyncResult.value.sourceProperty, which will be either body or subject. - * - * [Api set: Mailbox 1.2] - * - * @returns - * The selected data as a string with format determined by coercionType. - * - * @remarks - * - * **{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}**: ReadItem - * - * **{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}**: Compose - * - * @param coercionType - Requests a format for the data. If Text, the method returns the plain text as a string , removing any HTML tags present. - * If HTML, the method returns the selected text, whether it is plaintext or HTML. - * @param callback - When the method completes, the function passed in the callback parameter is called with a single parameter of - * type Office.AsyncResult. - */ - getSelectedDataAsync(coercionType: Office.CoercionType | string, callback: (asyncResult: Office.AsyncResult) => void): void; - /** - * Removes an attachment from a message or appointment. - * - * The removeAttachmentAsync method removes the attachment with the specified identifier from the item. - * As a best practice, you should use the attachment identifier to remove an attachment only if the same mail app has added that attachment - * in the same session. In Outlook on the web and mobile devices, the attachment identifier is valid only within the same session. - * A session is over when the user closes the app, or if the user starts composing an inline form then subsequently pops out the form to - * continue in a separate window. - * - * [Api set: Mailbox 1.1] - * - * @remarks - * - * **{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}**: ReadWriteItem - * - * **{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}**: Compose - * - * **Errors**: - * - * - InvalidAttachmentId: The attachment identifier does not exist. - * - * @param attachmentId - The identifier of the attachment to remove. - * @param options - Optional. An object literal that contains one or more of the following properties. - * asyncContext: Developers can provide any object they wish to access in the callback method. - * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of - * type Office.AsyncResult. - * If removing the attachment fails, the asyncResult.error property will contain an error code with the reason for the failure. - */ - removeAttachmentAsync(attachmentId: string, options?: Office.AsyncContextOptions, callback?: (asyncResult: Office.AsyncResult) => void): void; - /** - * Removes an attachment from a message or appointment. - * - * The removeAttachmentAsync method removes the attachment with the specified identifier from the item. - * As a best practice, you should use the attachment identifier to remove an attachment only if the same mail app has added that attachment - * in the same session. In Outlook on the web and mobile devices, the attachment identifier is valid only within the same session. - * A session is over when the user closes the app, or if the user starts composing an inline form then subsequently pops out the form to - * continue in a separate window. - * - * [Api set: Mailbox 1.1] - * - * @remarks - * - * **{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}**: ReadWriteItem - * - * **{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}**: Compose - * - * **Errors**: - * - * - InvalidAttachmentId: The attachment identifier does not exist. - * - * @param attachmentId - The identifier of the attachment to remove. - * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of - * type Office.AsyncResult. - * If removing the attachment fails, the asyncResult.error property will contain an error code with the reason for the failure. - */ - removeAttachmentAsync(attachmentId: string, callback?: (asyncResult: Office.AsyncResult) => void): void; - /** - * Asynchronously saves an item. - * - * When invoked, this method saves the current message as a draft and returns the item id via the callback method. - * In Outlook on the web or Outlook in online mode, the item is saved to the server. - * In Outlook in cached mode, the item is saved to the local cache. - * - * Since appointments have no draft state, if saveAsync is called on an appointment in compose mode, the item will be saved as a normal - * appointment on the user's calendar. For new appointments that have not been saved before, no invitation will be sent. - * Saving an existing appointment will send an update to added or removed attendees. - * - * **Note**: If your add-in calls saveAsync on an item in compose mode in order to get an itemId to use with EWS or the REST API, be aware that - * when Outlook is in cached mode, it may take some time before the item is actually synced to the server. - * Until the item is synced, using the itemId will return an error. - * - * **Note**: The following clients have different behavior for saveAsync on appointments in compose mode: - * - * - Outlook on Mac does not support saving a meeting. The saveAsync method fails when called from a meeting in compose mode. - * See {@link https://support.microsoft.com/help/4505745 | Cannot save a meeting as a draft in Outlook for Mac by using Office JS API} for a workaround. - * - * - Outlook on the web always sends an invitation or update when saveAsync is called on an appointment in compose mode. - * - * [Api set: Mailbox 1.3] - * - * @remarks - * - * **{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}**: ReadWriteItem - * - * **{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}**: Compose - * - * **Errors**: - * - * - InvalidAttachmentId: The attachment identifier does not exist. - * - * @param options - An object literal that contains one or more of the following properties. - * asyncContext: Developers can provide any object they wish to access in the callback method. - * @param callback - When the method completes, the function passed in the callback parameter is called with a single parameter of - * type Office.AsyncResult. - * If removing the attachment fails, the asyncResult.error property will contain an error code with the reason for the failure. - */ - saveAsync(options: Office.AsyncContextOptions, callback: (asyncResult: Office.AsyncResult) => void): void; - /** - * Asynchronously saves an item. - * - * When invoked, this method saves the current message as a draft and returns the item id via the callback method. - * In Outlook on the web or Outlook in online mode, the item is saved to the server. - * In Outlook in cached mode, the item is saved to the local cache. - * - * Since appointments have no draft state, if saveAsync is called on an appointment in compose mode, the item will be saved as a normal - * appointment on the user's calendar. For new appointments that have not been saved before, no invitation will be sent. - * Saving an existing appointment will send an update to added or removed attendees. - * - * **Note**: If your add-in calls saveAsync on an item in compose mode in order to get an itemId to use with EWS or the REST API, be aware that - * when Outlook is in cached mode, it may take some time before the item is actually synced to the server. - * Until the item is synced, using the itemId will return an error. - * - * **Note**: The following clients have different behavior for saveAsync on appointments in compose mode: - * - * - Outlook on Mac does not support saving a meeting. The saveAsync method fails when called from a meeting in compose mode. - * See {@link https://support.microsoft.com/help/4505745 | Cannot save a meeting as a draft in Outlook for Mac by using Office JS API} for a workaround. - * - * - Outlook on the web always sends an invitation or update when saveAsync is called on an appointment in compose mode. - * - * [Api set: Mailbox 1.3] - * - * @remarks - * - * **{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}**: ReadWriteItem - * - * **{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}**: Compose - * - * **Errors**: - * - * - InvalidAttachmentId: The attachment identifier does not exist. - * - * @param callback - When the method completes, the function passed in the callback parameter is called with a single parameter of - * type Office.AsyncResult. - * If removing the attachment fails, the asyncResult.error property will contain an error code with the reason for the failure. - */ - saveAsync(callback: (asyncResult: Office.AsyncResult) => void): void; - /** - * Asynchronously inserts data into the body or subject of a message. - * - * The setSelectedDataAsync method inserts the specified string at the cursor location in the subject or body of the item, or, if text is - * selected in the editor, it replaces the selected text. If the cursor is not in the body or subject field, an error is returned. - * After insertion, the cursor is placed at the end of the inserted content. - * - * [Api set: Mailbox 1.2] - * - * @remarks - * - * **{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}**: ReadWriteItem - * - * **{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}**: Compose - * - * **Errors**: - * - * - InvalidAttachmentId: The attachment identifier does not exist. - * - * @param data - The data to be inserted. Data is not to exceed 1,000,000 characters. - * If more than 1,000,000 characters are passed in, an ArgumentOutOfRange exception is thrown. - * @param options - Optional. An object literal that contains one or more of the following properties. - * asyncContext: Developers can provide any object they wish to access in the callback method. - * coercionType: If text, the current style is applied in Outlook on the web and desktop clients. - * If the field is an HTML editor, only the text data is inserted, even if the data is HTML. - * If html and the field supports HTML (the subject doesn't), the current style is applied in Outlook on the web and the default style is - * applied in Outlook on desktop clients. - * If the field is a text field, an InvalidDataFormat error is returned. - * If coercionType is not set, the result depends on the field: if the field is HTML then HTML is used; - * if the field is text, then plain text is used. - * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of - * type Office.AsyncResult. - */ - setSelectedDataAsync(data: string, options?: Office.AsyncContextOptions & CoercionTypeOptions, callback?: (asyncResult: Office.AsyncResult) => void): void; - /** - * Asynchronously inserts data into the body or subject of a message. - * - * The setSelectedDataAsync method inserts the specified string at the cursor location in the subject or body of the item, or, if text is - * selected in the editor, it replaces the selected text. If the cursor is not in the body or subject field, an error is returned. - * After insertion, the cursor is placed at the end of the inserted content. - * - * [Api set: Mailbox 1.2] - * - * @remarks - * - * **{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}**: ReadWriteItem - * - * **{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}**: Compose - * - * **Errors**: - * - * - InvalidAttachmentId: The attachment identifier does not exist. - * - * @param data - The data to be inserted. Data is not to exceed 1,000,000 characters. - * If more than 1,000,000 characters are passed in, an ArgumentOutOfRange exception is thrown. - * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of - * type Office.AsyncResult. - */ - setSelectedDataAsync(data: string, callback?: (asyncResult: Office.AsyncResult) => void): void; } /** * The read mode of {@link Office.Item | Office.context.mailbox.item}. @@ -12742,398 +12070,14 @@ declare namespace Office { * **Important**: This is an internal Outlook object, not directly exposed through existing interfaces. * You should treat this as a mode of Office.context.mailbox.item. Refer to the * {@link https://docs.microsoft.com/office/dev/add-ins/reference/objectmodel/preview-requirement-set/office.context.mailbox.item | Object Model} page for more information. + * + * Child interfaces: + * + * - {@link Office.AppointmentRead | AppointmentRead} + * + * - {@link Office.MessageRead | MessageRead} */ interface ItemRead extends Item { - /** - * Gets the item's attachments as an array. - * - * @remarks - * - * **{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}**: ReadItem - * - * **{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}**: Read - * - * **Note**: Certain types of files are blocked by Outlook due to potential security issues and are therefore not returned. - * For more information, see - * {@link https://support.office.com/article/Blocked-attachments-in-Outlook-434752E1-02D3-4E90-9124-8B81E49A8519 | Blocked attachments in Outlook}. - * - */ - attachments: AttachmentDetails[]; - /** - * Gets the Exchange Web Services item class of the selected item. - * - * You can create custom message classes that extends a default message class, for example, a custom appointment message class - * IPM.Appointment.Contoso. - * - * @remarks - * - * **{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}**: ReadItem - * - * **{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}**: Read - * - * The itemClass property specifies the message class of the selected item. The following are the default message classes for the message or - * appointment item. - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
TypeDescriptionItem Class
Appointment itemsThese are calendar items of the item class IPM.Appointment or IPM.Appointment.Occurrence.IPM.Appointment,IPM.Appointment.Occurrence
Message itemsThese include email messages that have the default message class IPM.Note, and meeting requests, responses, and cancellations, that use IPM.Schedule.Meeting as the base message class.IPM.Note,IPM.Schedule.Meeting.Request,IPM.Schedule.Meeting.Neg,IPM.Schedule.Meeting.Pos,IPM.Schedule.Meeting.Tent,IPM.Schedule.Meeting.Canceled
- */ - itemClass: string; - /** - * Gets the {@link https://docs.microsoft.com/exchange/client-developer/exchange-web-services/ews-identifiers-in-exchange | Exchange Web Services item identifier} - * for the current item. - * - * The itemId property is not available in compose mode. - * If an item identifier is required, the saveAsync method can be used to save the item to the store, which will return the item identifier - * in the asyncResult.value parameter in the callback function. - * - * **Note**: The identifier returned by the itemId property is the same as the - * {@link https://docs.microsoft.com/exchange/client-developer/exchange-web-services/ews-identifiers-in-exchange | Exchange Web Services item identifier}. - * The itemId property is not identical to the Outlook Entry ID or the ID used by the Outlook REST API. - * Before making REST API calls using this value, it should be converted using Office.context.mailbox.convertToRestId. - * For more details, see {@link https://docs.microsoft.com/outlook/add-ins/use-rest-api#get-the-item-id | Use the Outlook REST APIs from an Outlook add-in}. - * - * @remarks - * - * **{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}**: ReadItem - * - * **{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}**: Read - */ - itemId: string; - /** - * Gets the subject of an item, with all prefixes removed (including RE: and FWD:). - * - * The normalizedSubject property gets the subject of the item, with any standard prefixes (such as RE: and FW:) that are added by - * email programs. To get the subject of the item with the prefixes intact, use the subject property. - * - * @remarks - * - * **{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}**: ReadItem - * - * **{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}**: Read - */ - normalizedSubject: string; - /** - * Gets the description that appears in the subject field of an item. - * - * The subject property gets or sets the entire subject of the item, as sent by the email server. - * - * The subject property returns a string. Use the normalizedSubject property to get the subject minus any leading prefixes such as RE: and FW:. - * - * @remarks - * - * **{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}**: ReadItem - * - * **{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}**: Read - */ - subject: string; - - /** - * Displays a reply form that includes the sender and all recipients of the selected message or the organizer and all attendees of the - * selected appointment. - * - * In Outlook on the web, the reply form is displayed as a pop-out form in the 3-column view and a pop-up form in the 2- or 1-column view. - * - * If any of the string parameters exceed their limits, displayReplyAllForm throws an exception. - * - * When attachments are specified in the formData.attachments parameter, Outlook on the web and desktop clients attempt to download all attachments and - * attach them to the reply form. If any attachments fail to be added, an error is shown in the form UI. - * If this isn't possible, then no error message is thrown. - * - * **Note**: This method is not supported in Outlook on iOS or Android. - * - * @remarks - * - * **{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}**: ReadItem - * - * **{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}**: Read - * - * @param formData - A string that contains text and HTML and that represents the body of the reply form. The string is limited to 32 KB - * OR a {@link Office.ReplyFormData | ReplyFormData} object that contains body or attachment data and a callback function. - * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, - * asyncResult, which is an Office.AsyncResult object. - */ - displayReplyAllForm(formData: string | ReplyFormData, callback?: (asyncResult: Office.AsyncResult) => void): void; - /** - * Displays a reply form that includes only the sender of the selected message or the organizer of the selected appointment. - * - * In Outlook on the web, the reply form is displayed as a pop-out form in the 3-column view and a pop-up form in the 2- or 1-column view. - * - * If any of the string parameters exceed their limits, displayReplyForm throws an exception. - * - * When attachments are specified in the formData.attachments parameter, Outlook on the web and desktop clients attempt to download all attachments and - * attach them to the reply form. If any attachments fail to be added, an error is shown in the form UI. - * If this isn't possible, then no error message is thrown. - * - * **Note**: This method is not supported in Outlook on iOS or Android. - * - * @remarks - * - * **{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}**: ReadItem - * - * **{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}**: Read - * - * @param formData - A string that contains text and HTML and that represents the body of the reply form. The string is limited to 32 KB - * OR a {@link Office.ReplyFormData | ReplyFormData} object that contains body or attachment data and a callback function. - * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, - * asyncResult, which is an Office.AsyncResult object. - */ - displayReplyForm(formData: string | ReplyFormData, callback?: (asyncResult: Office.AsyncResult) => void): void; - /** - * Gets initialization data passed when the add-in is {@link https://docs.microsoft.com/outlook/actionable-messages/invoke-add-in-from-actionable-message | activated by an actionable message}. - * - * **Note**: This method is only supported by Outlook 2016 or later on Windows (Click-to-Run versions greater than 16.0.8413.1000) and Outlook on the web - * for Office 365. - * - * [Api set: Mailbox Preview] - * - * @remarks - * - * **{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}**: ReadItem - * - * **{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}**: Read - * - * @param options - Optional. An object literal that contains one or more of the following properties. - * asyncContext: Developers can provide any object they wish to access in the callback method. - * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, - * asyncResult, which is an Office.AsyncResult object. - * On success, the initialization data is provided in the asyncResult.value property as a string. - * If there is no initialization context, the asyncResult object will contain an Error object with its code property - * set to 9020 and its name property set to GenericResponseError. - * - * @beta - */ - getInitializationContextAsync(options?: Office.AsyncContextOptions, callback?: (asyncResult: Office.AsyncResult) => void): void; - /** - * Gets initialization data passed when the add-in is {@link https://docs.microsoft.com/outlook/actionable-messages/invoke-add-in-from-actionable-message | activated by an actionable message}. - * - * **Note**: This method is only supported by Outlook 2016 or later on Windows (Click-to-Run versions greater than 16.0.8413.1000) and Outlook on the web - * for Office 365. - * - * [Api set: Mailbox Preview] - * - * @remarks - * - * **{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}**: ReadItem - * - * **{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}**: Read - * - * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, - * asyncResult, which is an Office.AsyncResult object. - * On success, the initialization data is provided in the asyncResult.value property as a string. - * If there is no initialization context, the asyncResult object will contain an Error object with its code property - * set to 9020 and its name property set to GenericResponseError. - * - * @beta - */ - getInitializationContextAsync(callback?: (asyncResult: Office.AsyncResult) => void): void; - /** - * Gets the entities found in the selected item's body. - * - * **Note**: This method is not supported in Outlook on iOS or Android. - * - * @remarks - * - * **{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}**: ReadItem - * - * **{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}**: Read - */ - getEntities(): Entities; - /** - * Gets an array of all the entities of the specified entity type found in the selected item's body. - * - * **Note**: This method is not supported in Outlook on iOS or Android. - * - * @param entityType - One of the EntityType enumeration values. - * - * @returns - * If the value passed in entityType is not a valid member of the EntityType enumeration, the method returns null. - * If no entities of the specified type are present in the item's body, the method returns an empty array. - * Otherwise, the type of the objects in the returned array depends on the type of entity requested in the entityType parameter. - * - * @remarks - * - * **{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}**: Restricted - * - * **{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}**: Read - * - * While the minimum permission level to use this method is Restricted, some entity types require ReadItem to access, as specified in the - * following table. - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Value of entityTypeType of objects in returned arrayRequired Permission Level
AddressStringRestricted
ContactContactReadItem
EmailAddressStringReadItem
MeetingSuggestionMeetingSuggestionReadItem
PhoneNumberPhoneNumberRestricted
TaskSuggestionTaskSuggestionReadItem
URLStringRestricted
- */ - getEntitiesByType(entityType: MailboxEnums.EntityType | string): (string | Contact | MeetingSuggestion | PhoneNumber | TaskSuggestion)[]; - /** - * Returns well-known entities in the selected item that pass the named filter defined in the manifest XML file. - * - * The getFilteredEntitiesByName method returns the entities that match the regular expression defined in the ItemHasKnownEntity rule element - * in the manifest XML file with the specified FilterName element value. - * - * **Note**: This method is not supported in Outlook on iOS or Android. - * - * @remarks - * - * **{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}**: ReadItem - * - * **{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}**: Read - * - * @param name - The name of the ItemHasKnownEntity rule element that defines the filter to match. - * @returns If there is no ItemHasKnownEntity element in the manifest with a FilterName element value that matches the name parameter, - * the method returns null. - * If the name parameter does match an ItemHasKnownEntity element in the manifest, but there are no entities in the current item that match, - * the method return an empty array. - */ - getFilteredEntitiesByName(name: string): (string | Contact | MeetingSuggestion | PhoneNumber | TaskSuggestion)[]; - /** - * Returns string values in the selected item that match the regular expressions defined in the manifest XML file. - * - * The getRegExMatches method returns the strings that match the regular expression defined in each ItemHasRegularExpressionMatch or - * ItemHasKnownEntity rule element in the manifest XML file. - * For an ItemHasRegularExpressionMatch rule, a matching string has to occur in the property of the item that is specified by that rule. - * The PropertyName simple type defines the supported properties. - * - * If you specify an ItemHasRegularExpressionMatch rule on the body property of an item, the regular expression should further filter the body - * and should not attempt to return the entire body of the item. - * Using a regular expression such as .* to obtain the entire body of an item does not always return the expected results. - * Instead, use the Body.getAsync method to retrieve the entire body. - * - * **Note**: This method is not supported in Outlook on iOS or Android. - * - * @returns - * An object that contains arrays of strings that match the regular expressions defined in the manifest XML file. - * The name of each array is equal to the corresponding value of the RegExName attribute of the matching ItemHasRegularExpressionMatch rule - * or the FilterName attribute of the matching ItemHasKnownEntity rule. - * - * @remarks - * - * **{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}**: ReadItem - * - * **{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}**: Read - */ - getRegExMatches(): any; - /** - * Returns string values in the selected item that match the named regular expression defined in the manifest XML file. - * - * The getRegExMatchesByName method returns the strings that match the regular expression defined in the ItemHasRegularExpressionMatch rule - * element in the manifest XML file with the specified RegExName element value. - * - * If you specify an ItemHasRegularExpressionMatch rule on the body property of an item, the regular expression should further filter the body - * and should not attempt to return the entire body of the item. - * Using a regular expression such as .* to obtain the entire body of an item does not always return the expected results. - * - * **Note**: This method is not supported in Outlook on iOS or Android. - * - * @returns - * An array that contains the strings that match the regular expression defined in the manifest XML file. - * - * @remarks - * - * **{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}**: ReadItem - * - * **{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}**: Read - * - * @param name - The name of the ItemHasRegularExpressionMatch rule element that defines the filter to match. - */ - getRegExMatchesByName(name: string): string[]; - /** - * Gets the entities found in a highlighted match a user has selected. Highlighted matches apply to contextual add-ins. - * - * **Note**: This method is not supported in Outlook on iOS or Android. - * - * [Api set: Mailbox 1.6] - * - * @remarks - * - * **{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}**: ReadItem - * - * **{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}**: Read - * - * @param name - The name of the ItemHasRegularExpressionMatch rule element that defines the filter to match. - */ - getSelectedEntities(): Entities; - /** - * Returns string values in a highlighted match that match the regular expressions defined in the manifest XML file. - * Highlighted matches apply to contextual add-ins. - * - * The getSelectedRegExMatches method returns the strings that match the regular expression defined in each ItemHasRegularExpressionMatch or - * ItemHasKnownEntity rule element in the manifest XML file. For an ItemHasRegularExpressionMatch rule, a matching string has to occur in the property of the item that is specified by that rule. The PropertyName simple type defines the supported properties. - * - * If you specify an ItemHasRegularExpressionMatch rule on the body property of an item, the regular expression should further filter the body - * and should not attempt to return the entire body of the item. - * Using a regular expression such as .* to obtain the entire body of an item does not always return the expected results. - * Instead, use the Body.getAsync method to retrieve the entire body. - * - * **Note**: This method is not supported in Outlook on iOS or Android. - * - * [Api set: Mailbox 1.6] - * - * @returns - * An object that contains arrays of strings that match the regular expressions defined in the manifest XML file. - * The name of each array is equal to the corresponding value of the RegExName attribute of the matching ItemHasRegularExpressionMatch rule - * or the FilterName attribute of the matching ItemHasKnownEntity rule. - * - * @remarks - * - * **{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}**: ReadItem - * - * **{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}**: Read - */ - getSelectedRegExMatches(): any; } /** * Represents a date and time in the local client's time zone. Read mode only. @@ -14090,25 +13034,14 @@ declare namespace Office { * **Important**: This is an internal Outlook object, not directly exposed through existing interfaces. * You should treat this as a mode of Office.context.mailbox.item. Refer to the * {@link https://docs.microsoft.com/office/dev/add-ins/reference/objectmodel/preview-requirement-set/office.context.mailbox.item | Object Model} page for more information. + * + * Child interfaces: + * + * - {@link Office.MessageCompose | MessageCompose} + * + * - {@link Office.MessageRead | MessageRead} */ interface Message extends Item { - /** - * Gets an identifier for the email conversation that contains a particular message. - * - * You can get an integer for this property if your mail app is activated in read forms or responses in compose forms. - * If subsequently the user changes the subject of the reply message, upon sending the reply, the conversation ID for that message will - * change and that value you obtained earlier will no longer apply. - * - * You get null for this property for a new item in a compose form. - * If the user sets a subject and saves the item, the conversationId property will return a value. - * - * @remarks - * - * **{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}**: ReadItem - * - * **{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}**: Compose or Read - */ - conversationId: string; } /** * The message compose mode of {@link Office.Item | Office.context.mailbox.item}. @@ -14116,6 +13049,12 @@ declare namespace Office { * **Important**: This is an internal Outlook object, not directly exposed through existing interfaces. * You should treat this as a mode of Office.context.mailbox.item. Refer to the * {@link https://docs.microsoft.com/office/dev/add-ins/reference/objectmodel/preview-requirement-set/office.context.mailbox.item | Object Model} page for more information. + * + * Parent interfaces: + * + * - {@link Office.ItemCompose | ItemCompose} + * + * - {@link Office.Message | Message} */ interface MessageCompose extends Message, ItemCompose { /** @@ -14574,6 +13513,62 @@ declare namespace Office { * **{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}**: Message Compose */ close(): void; + /** + * Gets an attachment from a message or appointment and returns it as an **AttachmentContent** object. + * + * The `getAttachmentContentAsync` method gets the attachment with the specified identifier from the item. As a best practice, you should use + * the identifier to retrieve an attachment in the same session that the attachmentIds were retrieved with the `getAttachmentsAsync` or + * `item.attachments` call. In Outlook on the web and mobile devices, the attachment identifier is valid only within the same session. + * A session is over when the user closes the app, or if the user starts composing an inline form then subsequently pops out the form to + * continue in a separate window. + * + * [Api set: Mailbox 1.8] + * + * @remarks + * + * **{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}**: ReadItem + * + * **{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}**: Message Compose + * + * **Errors**: + * + * - InvalidAttachmentId: The attachment identifier does not exist. + * + * @param attachmentId - The identifier of the attachment you want to get. + * @param options - Optional. An object literal that contains one or more of the following properties. + * asyncContext: Developers can provide any object they wish to access in the callback method. + * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, + * asyncResult, which is an Office.AsyncResult object. If the call fails, the asyncResult.error property will contain and error code + * with the reason for the failure. + */ + getAttachmentContentAsync(attachmentId: string, options?: Office.AsyncContextOptions, callback?: (asyncResult: Office.AsyncResult) => void): void; + /** + * Gets an attachment from a message or appointment and returns it as an **AttachmentContent** object. + * + * The `getAttachmentContentAsync` method gets the attachment with the specified identifier from the item. As a best practice, you should use + * the identifier to retrieve an attachment in the same session that the attachmentIds were retrieved with the `getAttachmentsAsync` or + * `item.attachments` call. In Outlook on the web and mobile devices, the attachment identifier is valid only within the same session. + * A session is over when the user closes the app, or if the user starts composing an inline form then subsequently pops out the form to + * continue in a separate window. + * + * [Api set: Mailbox 1.8] + * + * @remarks + * + * **{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}**: ReadItem + * + * **{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}**: Message Compose + * + * **Errors**: + * + * - InvalidAttachmentId: The attachment identifier does not exist. + * + * @param attachmentId - The identifier of the attachment you want to get. + * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, + * asyncResult, which is an Office.AsyncResult object. If the call fails, the asyncResult.error property will contain and error code + * with the reason for the failure. + */ + getAttachmentContentAsync(attachmentId: string, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Gets the item's attachments as an array. * @@ -14764,6 +13759,40 @@ declare namespace Office { * type Office.AsyncResult. */ getSelectedDataAsync(coercionType: Office.CoercionType | string, callback: (asyncResult: Office.AsyncResult) => void): void; + /** + * Gets the properties of an appointment or message in a shared folder, calendar, or mailbox. + * + * [Api set: Mailbox 1.8] + * + * @remarks + * + * **{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}**: ReadItem + * + * **{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}**: Message Compose + * + * @param options - An object literal that contains one or more of the following properties. + * asyncContext: Developers can provide any object they wish to access in the callback method. + * @param callback - When the method completes, the function passed in the callback parameter is called with a single parameter of + * type Office.AsyncResult. + * The `value` property of the result is the properties of the shared item. + */ + getSharedPropertiesAsync(options: Office.AsyncContextOptions, callback: (asyncResult: Office.AsyncResult) => void): void; + /** + * Gets the properties of an appointment or message in a shared folder, calendar, or mailbox. + * + * [Api set: Mailbox 1.8] + * + * @remarks + * + * **{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}**: ReadItem + * + * **{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}**: Message Compose + * + * @param callback - When the method completes, the function passed in the callback parameter is called with a single parameter of + * type Office.AsyncResult. + * The `value` property of the result is the properties of the shared item. + */ + getSharedPropertiesAsync(callback: (asyncResult: Office.AsyncResult) => void): void; /** * Asynchronously loads custom properties for this add-in on the selected item. * @@ -15024,6 +14053,12 @@ declare namespace Office { * **Important**: This is an internal Outlook object, not directly exposed through existing interfaces. * You should treat this as a mode of Office.context.mailbox.item. Refer to the * {@link https://docs.microsoft.com/office/dev/add-ins/reference/objectmodel/preview-requirement-set/office.context.mailbox.item | Object Model} page for more information. + * + * Parent interfaces: + * + * - {@link Office.ItemRead | ItemRead} + * + * - {@link Office.Message | Message} */ interface MessageRead extends Message, ItemRead { /** @@ -15501,6 +14536,62 @@ declare namespace Office { * If the call fails, the asyncResult.error property will contain an error code with the reason for the failure. */ getAllInternetHeadersAsync(callback?: (asyncResult: Office.AsyncResult) => void): void; + /** + * Gets an attachment from a message or appointment and returns it as an **AttachmentContent** object. + * + * The `getAttachmentContentAsync` method gets the attachment with the specified identifier from the item. As a best practice, you should use + * the identifier to retrieve an attachment in the same session that the attachmentIds were retrieved with the `getAttachmentsAsync` or + * `item.attachments` call. In Outlook on the web and mobile devices, the attachment identifier is valid only within the same session. + * A session is over when the user closes the app, or if the user starts composing an inline form then subsequently pops out the form to + * continue in a separate window. + * + * [Api set: Mailbox 1.8] + * + * @remarks + * + * **{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}**: ReadItem + * + * **{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}**: Message Read + * + * **Errors**: + * + * - InvalidAttachmentId: The attachment identifier does not exist. + * + * @param attachmentId - The identifier of the attachment you want to get. + * @param options - Optional. An object literal that contains one or more of the following properties. + * asyncContext: Developers can provide any object they wish to access in the callback method. + * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, + * asyncResult, which is an Office.AsyncResult object. If the call fails, the asyncResult.error property will contain and error code + * with the reason for the failure. + */ + getAttachmentContentAsync(attachmentId: string, options?: Office.AsyncContextOptions, callback?: (asyncResult: Office.AsyncResult) => void): void; + /** + * Gets an attachment from a message or appointment and returns it as an **AttachmentContent** object. + * + * The `getAttachmentContentAsync` method gets the attachment with the specified identifier from the item. As a best practice, you should use + * the identifier to retrieve an attachment in the same session that the attachmentIds were retrieved with the `getAttachmentsAsync` or + * `item.attachments` call. In Outlook on the web and mobile devices, the attachment identifier is valid only within the same session. + * A session is over when the user closes the app, or if the user starts composing an inline form then subsequently pops out the form to + * continue in a separate window. + * + * [Api set: Mailbox 1.8] + * + * @remarks + * + * **{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}**: ReadItem + * + * **{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}**: Message Read + * + * **Errors**: + * + * - InvalidAttachmentId: The attachment identifier does not exist. + * + * @param attachmentId - The identifier of the attachment you want to get. + * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, + * asyncResult, which is an Office.AsyncResult object. If the call fails, the asyncResult.error property will contain and error code + * with the reason for the failure. + */ + getAttachmentContentAsync(attachmentId: string, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Gets initialization data passed when the add-in is * {@link https://docs.microsoft.com/outlook/actionable-messages/invoke-add-in-from-actionable-message | activated by an actionable message}. @@ -15746,6 +14837,40 @@ declare namespace Office { * **{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}**: Message Read */ getSelectedRegExMatches(): any; + /** + * Gets the properties of an appointment or message in a shared folder, calendar, or mailbox. + * + * [Api set: Mailbox 1.8] + * + * @remarks + * + * **{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}**: ReadItem + * + * **{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}**: Message Read + * + * @param options - An object literal that contains one or more of the following properties. + * asyncContext: Developers can provide any object they wish to access in the callback method. + * @param callback - When the method completes, the function passed in the callback parameter is called with a single parameter of + * type Office.AsyncResult. + * The `value` property of the result is the properties of the shared item. + */ + getSharedPropertiesAsync(options: Office.AsyncContextOptions, callback: (asyncResult: Office.AsyncResult) => void): void; + /** + * Gets the properties of an appointment or message in a shared folder, calendar, or mailbox. + * + * [Api set: Mailbox 1.8] + * + * @remarks + * + * **{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}**: ReadItem + * + * **{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}**: Message Read + * + * @param callback - When the method completes, the function passed in the callback parameter is called with a single parameter of + * type Office.AsyncResult. + * The `value` property of the result is the properties of the shared item. + */ + getSharedPropertiesAsync(callback: (asyncResult: Office.AsyncResult) => void): void; /** * Asynchronously loads custom properties for this add-in on the selected item. * diff --git a/types/office-js/index.d.ts b/types/office-js/index.d.ts index 6957e5d82d..1980108fdd 100644 --- a/types/office-js/index.d.ts +++ b/types/office-js/index.d.ts @@ -8765,6 +8765,12 @@ declare namespace Office { * **Important**: This is an internal Outlook object, not directly exposed through existing interfaces. * You should treat this as a mode of Office.context.mailbox.item. Refer to the * {@link https://docs.microsoft.com/office/dev/add-ins/reference/objectmodel/requirement-set-1.8/office.context.mailbox.item | Object Model} page for more information. + * + * Child interfaces: + * + * - {@link Office.AppointmentCompose | AppointmentCompose} + * + * - {@link Office.AppointmentRead | AppointmentRead} */ interface Appointment extends Item { } @@ -8774,6 +8780,12 @@ declare namespace Office { * **Important**: This is an internal Outlook object, not directly exposed through existing interfaces. * You should treat this as a mode of Office.context.mailbox.item. Refer to the * {@link https://docs.microsoft.com/office/dev/add-ins/reference/objectmodel/requirement-set-1.8/office.context.mailbox.item | Object Model} page for more information. + * + * Parent interfaces: + * + * - {@link Office.ItemCompose | ItemCompose} + * + * - {@link Office.Appointment | Appointment} */ interface AppointmentCompose extends Appointment, ItemCompose { /** @@ -9248,6 +9260,62 @@ declare namespace Office { * **{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}**: Appointment Organizer */ close(): void; + /** + * Gets an attachment from a message or appointment and returns it as an **AttachmentContent** object. + * + * The `getAttachmentContentAsync` method gets the attachment with the specified identifier from the item. As a best practice, you should use + * the identifier to retrieve an attachment in the same session that the attachmentIds were retrieved with the `getAttachmentsAsync` or + * `item.attachments` call. In Outlook on the web and mobile devices, the attachment identifier is valid only within the same session. + * A session is over when the user closes the app, or if the user starts composing an inline form then subsequently pops out the form to + * continue in a separate window. + * + * [Api set: Mailbox 1.8] + * + * @remarks + * + * **{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}**: ReadItem + * + * **{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}**: Appointment Organizer + * + * **Errors**: + * + * - InvalidAttachmentId: The attachment identifier does not exist. + * + * @param attachmentId - The identifier of the attachment you want to get. + * @param options - Optional. An object literal that contains one or more of the following properties. + * asyncContext: Developers can provide any object they wish to access in the callback method. + * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, + * asyncResult, which is an Office.AsyncResult object. If the call fails, the asyncResult.error property will contain and error code + * with the reason for the failure. + */ + getAttachmentContentAsync(attachmentId: string, options?: Office.AsyncContextOptions, callback?: (asyncResult: Office.AsyncResult) => void): void; + /** + * Gets an attachment from a message or appointment and returns it as an **AttachmentContent** object. + * + * The `getAttachmentContentAsync` method gets the attachment with the specified identifier from the item. As a best practice, you should use + * the identifier to retrieve an attachment in the same session that the attachmentIds were retrieved with the `getAttachmentsAsync` or + * `item.attachments` call. In Outlook on the web and mobile devices, the attachment identifier is valid only within the same session. + * A session is over when the user closes the app, or if the user starts composing an inline form then subsequently pops out the form to + * continue in a separate window. + * + * [Api set: Mailbox 1.8] + * + * @remarks + * + * **{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}**: ReadItem + * + * **{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}**: Appointment Organizer + * + * **Errors**: + * + * - InvalidAttachmentId: The attachment identifier does not exist. + * + * @param attachmentId - The identifier of the attachment you want to get. + * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, + * asyncResult, which is an Office.AsyncResult object. If the call fails, the asyncResult.error property will contain and error code + * with the reason for the failure. + */ + getAttachmentContentAsync(attachmentId: string, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Gets the item's attachments as an array. * @@ -9385,6 +9453,40 @@ declare namespace Office { * type Office.AsyncResult. */ getSelectedDataAsync(coercionType: Office.CoercionType | string, callback: (asyncResult: Office.AsyncResult) => void): void; + /** + * Gets the properties of an appointment or message in a shared folder, calendar, or mailbox. + * + * [Api set: Mailbox 1.8] + * + * @remarks + * + * **{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}**: ReadItem + * + * **{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}**: Appointment Organizer + * + * @param options - An object literal that contains one or more of the following properties. + * asyncContext: Developers can provide any object they wish to access in the callback method. + * @param callback - When the method completes, the function passed in the callback parameter is called with a single parameter of + * type Office.AsyncResult. + * The `value` property of the result is the properties of the shared item. + */ + getSharedPropertiesAsync(options: Office.AsyncContextOptions, callback: (asyncResult: Office.AsyncResult) => void): void; + /** + * Gets the properties of an appointment or message in a shared folder, calendar, or mailbox. + * + * [Api set: Mailbox 1.8] + * + * @remarks + * + * **{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}**: ReadItem + * + * **{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}**: Appointment Organizer + * + * @param callback - When the method completes, the function passed in the callback parameter is called with a single parameter of + * type Office.AsyncResult. + * The `value` property of the result is the properties of the shared item. + */ + getSharedPropertiesAsync(callback: (asyncResult: Office.AsyncResult) => void): void; /** * Asynchronously loads custom properties for this add-in on the selected item. * @@ -9810,6 +9912,12 @@ declare namespace Office { * **Important**: This is an internal Outlook object, not directly exposed through existing interfaces. * You should treat this as a mode of Office.context.mailbox.item. Refer to the * {@link https://docs.microsoft.com/office/dev/add-ins/reference/objectmodel/requirement-set-1.8/office.context.mailbox.item | Object Model} page for more information. + * + * Parent interfaces: + * + * - {@link Office.ItemRead | ItemRead} + * + * - {@link Office.Appointment | Appointment} */ interface AppointmentRead extends Appointment, ItemRead { /** @@ -10207,6 +10315,62 @@ declare namespace Office { * asyncResult, which is an Office.AsyncResult object. */ displayReplyForm(formData: string | ReplyFormData, callback?: (asyncResult: Office.AsyncResult) => void): void; + /** + * Gets an attachment from a message or appointment and returns it as an **AttachmentContent** object. + * + * The `getAttachmentContentAsync` method gets the attachment with the specified identifier from the item. As a best practice, you should use + * the identifier to retrieve an attachment in the same session that the attachmentIds were retrieved with the `getAttachmentsAsync` or + * `item.attachments` call. In Outlook on the web and mobile devices, the attachment identifier is valid only within the same session. + * A session is over when the user closes the app, or if the user starts composing an inline form then subsequently pops out the form to + * continue in a separate window. + * + * [Api set: Mailbox 1.8] + * + * @remarks + * + * **{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}**: ReadItem + * + * **{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}**: Appointment Attendee + * + * **Errors**: + * + * - InvalidAttachmentId: The attachment identifier does not exist. + * + * @param attachmentId - The identifier of the attachment you want to get. + * @param options - Optional. An object literal that contains one or more of the following properties. + * asyncContext: Developers can provide any object they wish to access in the callback method. + * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, + * asyncResult, which is an Office.AsyncResult object. If the call fails, the asyncResult.error property will contain and error code + * with the reason for the failure. + */ + getAttachmentContentAsync(attachmentId: string, options?: Office.AsyncContextOptions, callback?: (asyncResult: Office.AsyncResult) => void): void; + /** + * Gets an attachment from a message or appointment and returns it as an **AttachmentContent** object. + * + * The `getAttachmentContentAsync` method gets the attachment with the specified identifier from the item. As a best practice, you should use + * the identifier to retrieve an attachment in the same session that the attachmentIds were retrieved with the `getAttachmentsAsync` or + * `item.attachments` call. In Outlook on the web and mobile devices, the attachment identifier is valid only within the same session. + * A session is over when the user closes the app, or if the user starts composing an inline form then subsequently pops out the form to + * continue in a separate window. + * + * [Api set: Mailbox 1.8] + * + * @remarks + * + * **{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}**: ReadItem + * + * **{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}**: Appointment Attendee + * + * **Errors**: + * + * - InvalidAttachmentId: The attachment identifier does not exist. + * + * @param attachmentId - The identifier of the attachment you want to get. + * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, + * asyncResult, which is an Office.AsyncResult object. If the call fails, the asyncResult.error property will contain and error code + * with the reason for the failure. + */ + getAttachmentContentAsync(attachmentId: string, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Gets the entities found in the selected item's body. * @@ -10401,6 +10565,40 @@ declare namespace Office { * **{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}**: Appointment Attendee */ getSelectedRegExMatches(): any; + /** + * Gets the properties of an appointment or message in a shared folder, calendar, or mailbox. + * + * [Api set: Mailbox 1.8] + * + * @remarks + * + * **{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}**: ReadItem + * + * **{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}**: Appointment Attendee + * + * @param options - An object literal that contains one or more of the following properties. + * asyncContext: Developers can provide any object they wish to access in the callback method. + * @param callback - When the method completes, the function passed in the callback parameter is called with a single parameter of + * type Office.AsyncResult. + * The `value` property of the result is the properties of the shared item. + */ + getSharedPropertiesAsync(options: Office.AsyncContextOptions, callback: (asyncResult: Office.AsyncResult) => void): void; + /** + * Gets the properties of an appointment or message in a shared folder, calendar, or mailbox. + * + * [Api set: Mailbox 1.8] + * + * @remarks + * + * **{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}**: ReadItem + * + * **{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}**: Appointment Attendee + * + * @param callback - When the method completes, the function passed in the callback parameter is called with a single parameter of + * type Office.AsyncResult. + * The `value` property of the result is the properties of the shared item. + */ + getSharedPropertiesAsync(callback: (asyncResult: Office.AsyncResult) => void): void; /** * Asynchronously loads custom properties for this add-in on the selected item. * @@ -11638,11 +11836,23 @@ declare namespace Office { * The item namespace is used to access the currently selected message, meeting request, or appointment. * You can determine the type of the item by using the `itemType` property. * - * If you want to see IntelliSense for only a specific type, cast this item to one of the following: + * If you want to see IntelliSense for only a specific type or mode, cast this item to one of the following: * - * {@link Office.ItemCompose | ItemCompose}, {@link Office.ItemRead | ItemRead}, - * {@link Office.MessageCompose | MessageCompose}, {@link Office.MessageRead | MessageRead}, - * {@link Office.AppointmentCompose | AppointmentCompose}, {@link Office.AppointmentRead | AppointmentRead} + * - {@link Office.Appointment | Appointment} + * + * - {@link Office.AppointmentCompose | AppointmentCompose} + * + * - {@link Office.AppointmentRead | AppointmentRead} + * + * - {@link Office.Message | Message} + * + * - {@link Office.MessageCompose | MessageCompose} + * + * - {@link Office.MessageRead | MessageRead} + * + * - {@link Office.ItemCompose | ItemCompose} + * + * - {@link Office.ItemRead | ItemRead} * * @remarks * @@ -11651,272 +11861,6 @@ declare namespace Office { * **{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}**: Compose or Read */ interface Item { - /** - * Gets an object that provides methods for manipulating the body of an item. - * - * [Api set: Mailbox 1.1] - * - * @remarks - * - * **{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}**: ReadItem - * - * **{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}**: Compose or Read - */ - body: Body; - /** - * Gets an object that provides methods for managing the item's categories. - * - * [Api set: Mailbox 1.8] - * - * @remarks - * - * **{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}**: ReadItem - * - * **{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}**: Compose or Read - */ - categories: Categories; - /** - * Gets the type of item that an instance represents. - * - * The itemType property returns one of the ItemType enumeration values, indicating whether the item object instance is a message or - * an appointment. - * - * @remarks - * - * **{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}**: ReadItem - * - * **{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}**: Compose or Read - */ - itemType: MailboxEnums.ItemType | string; - /** - * Gets the notification messages for an item. - * - * [Api set: Mailbox 1.3] - * - * @remarks - * - * **{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}**: ReadItem - * - * **{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}**: Compose or Read - */ - notificationMessages: NotificationMessages; - /** - * Gets the id of the series that an instance belongs to. - * - * In Outlook on the web and desktop clients, the seriesId returns the Exchange Web Services (EWS) ID of the parent (series) item that this item belongs to. - * However, on iOS and Android, the seriesId returns the REST ID of the parent item. - * - * **Note**: The identifier returned by the seriesId property is the same as the Exchange Web Services item identifier. - * The seriesId property is not identical to the Outlook IDs used by the Outlook REST API. - * Before making REST API calls using this value, it should be converted using Office.context.mailbox.convertToRestId. - * For more details, see {@link https://docs.microsoft.com/outlook/add-ins/use-rest-api | Use the Outlook REST APIs from an Outlook add-in}. - * - * The seriesId property returns null for items that do not have parent items such as single appointments, series items, or meeting requests - * and returns undefined for any other items that are not meeting requests. - * - * [Api set: Mailbox 1.7] - * - * @remarks - * - * **{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}**: ReadItem - * - * **{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}**: Compose or Read - */ - seriesId: string; - - /** - * Adds an event handler for a supported event. **Note**: Events are available only with task pane. - * - * To see which event types are supported, see `Office.EventType` for details. - * - * [Api set: Mailbox 1.7] - * - * @remarks - * - * **{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}**: ReadItem - * - * **{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}**: Compose or Read - * - * @param eventType - The event that should invoke the handler. - * @param handler - The function to handle the event. The function must accept a single parameter, which is an object literal. - * The type property on the parameter will match the eventType parameter passed to addHandlerAsync. - * @param options - Optional. An object literal that contains one or more of the following properties. - * asyncContext: Developers can provide any object they wish to access in the callback method. - * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, - * asyncResult, which is an Office.AsyncResult object. - */ - addHandlerAsync(eventType: Office.EventType | string, handler: any, options?: Office.AsyncContextOptions, callback?: (asyncResult: Office.AsyncResult) => void): void; - /** - * Adds an event handler for a supported event. **Note**: Events are available only with task pane. - * - * To see which event types are supported, see `Office.EventType` for details. - * - * [Api set: Mailbox 1.7] - * - * @remarks - * - * **{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}**: ReadItem - * - * **{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}**: Compose or Read - * - * @param eventType - The event that should invoke the handler. - * @param handler - The function to handle the event. The function must accept a single parameter, which is an object literal. - * The type property on the parameter will match the eventType parameter passed to addHandlerAsync. - * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, - * asyncResult, which is an Office.AsyncResult object. - */ - addHandlerAsync(eventType: Office.EventType | string, handler: any, callback?: (asyncResult: Office.AsyncResult) => void): void; - /** - * Gets an attachment from a message or appointment and returns it as an **AttachmentContent** object. - * - * The `getAttachmentContentAsync` method gets the attachment with the specified identifier from the item. As a best practice, you should use - * the identifier to retrieve an attachment in the same session that the attachmentIds were retrieved with the `getAttachmentsAsync` or - * `item.attachments` call. In Outlook on the web and mobile devices, the attachment identifier is valid only within the same session. - * A session is over when the user closes the app, or if the user starts composing an inline form then subsequently pops out the form to - * continue in a separate window. - * - * [Api set: Mailbox 1.8] - * - * @remarks - * - * **{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}**: ReadItem - * - * **{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}**: Compose or Read - * - * **Errors**: - * - * - InvalidAttachmentId: The attachment identifier does not exist. - * - * @param attachmentId - The identifier of the attachment you want to get. - * @param options - Optional. An object literal that contains one or more of the following properties. - * asyncContext: Developers can provide any object they wish to access in the callback method. - * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, - * asyncResult, which is an Office.AsyncResult object. If the call fails, the asyncResult.error property will contain and error code - * with the reason for the failure. - */ - getAttachmentContentAsync(attachmentId: string, options?: Office.AsyncContextOptions, callback?: (asyncResult: Office.AsyncResult) => void): void; - /** - * Gets an attachment from a message or appointment and returns it as an **AttachmentContent** object. - * - * The `getAttachmentContentAsync` method gets the attachment with the specified identifier from the item. As a best practice, you should use - * the identifier to retrieve an attachment in the same session that the attachmentIds were retrieved with the `getAttachmentsAsync` or - * `item.attachments` call. In Outlook on the web and mobile devices, the attachment identifier is valid only within the same session. - * A session is over when the user closes the app, or if the user starts composing an inline form then subsequently pops out the form to - * continue in a separate window. - * - * [Api set: Mailbox 1.8] - * - * @remarks - * - * **{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}**: ReadItem - * - * **{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}**: Compose or Read - * - * **Errors**: - * - * - InvalidAttachmentId: The attachment identifier does not exist. - * - * @param attachmentId - The identifier of the attachment you want to get. - * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, - * asyncResult, which is an Office.AsyncResult object. If the call fails, the asyncResult.error property will contain and error code - * with the reason for the failure. - */ - getAttachmentContentAsync(attachmentId: string, callback?: (asyncResult: Office.AsyncResult) => void): void; - /** - * Gets the properties of an appointment or message in a shared folder, calendar, or mailbox. - * - * [Api set: Mailbox 1.8] - * - * @remarks - * - * **{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}**: ReadItem - * - * **{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}**: Compose or Read - * - * @param options - An object literal that contains one or more of the following properties. - * asyncContext: Developers can provide any object they wish to access in the callback method. - * @param callback - When the method completes, the function passed in the callback parameter is called with a single parameter of - * type Office.AsyncResult. - * The `value` property of the result is the properties of the shared item. - */ - getSharedPropertiesAsync(options: Office.AsyncContextOptions, callback: (asyncResult: Office.AsyncResult) => void): void; - /** - * Gets the properties of an appointment or message in a shared folder, calendar, or mailbox. - * - * [Api set: Mailbox 1.8] - * - * @remarks - * - * **{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}**: ReadItem - * - * **{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}**: Compose or Read - * - * @param callback - When the method completes, the function passed in the callback parameter is called with a single parameter of - * type Office.AsyncResult. - * The `value` property of the result is the properties of the shared item. - */ - getSharedPropertiesAsync(callback: (asyncResult: Office.AsyncResult) => void): void; - /** - * Asynchronously loads custom properties for this add-in on the selected item. - * - * Custom properties are stored as key/value pairs on a per-app, per-item basis. - * This method returns a CustomProperties object in the callback, which provides methods to access the custom properties specific to the - * current item and the current add-in. Custom properties are not encrypted on the item, so this should not be used as secure storage. - * - * The custom properties are provided as a CustomProperties object in the asyncResult.value property. - * This object can be used to get, set, and remove custom properties from the item and save changes to the custom property set back to - * the server. - * - * @remarks - * - * **{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}**: ReadItem - * - * **{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}**: Compose or Read - * - * @param callback - When the method completes, the function passed in the callback parameter is called with a single parameter of - * type Office.AsyncResult. - * @param userContext - Optional. Developers can provide any object they wish to access in the callback function. - * This object can be accessed by the asyncResult.asyncContext property in the callback function. - */ - loadCustomPropertiesAsync(callback: (asyncResult: Office.AsyncResult) => void, userContext?: any): void; - /** - * Removes the event handlers for a supported event type. **Note**: Events are available only with task pane. - * - * To see which event types are supported, see `Office.EventType` for details. - * - * [Api set: Mailbox 1.7] - * - * @remarks - * - * **{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}**: ReadItem - * - * **{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}**: Compose or Read - * - * @param eventType - The event that should revoke the handler. - * @param options - Optional. An object literal that contains one or more of the following properties. - * asyncContext: Developers can provide any object they wish to access in the callback method. - * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, - * asyncResult, which is an Office.AsyncResult object. - */ - removeHandlerAsync(eventType: Office.EventType | string, options?: Office.AsyncContextOptions, callback?: (asyncResult: Office.AsyncResult) => void): void; - /** - * Removes the event handlers for a supported event type. **Note**: Events are available only with task pane. - * - * To see which event types are supported, see `Office.EventType` for details. - * - * [Api set: Mailbox 1.7] - * - * @remarks - * - * **{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}**: ReadItem - * - * **{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}**: Compose or Read - * - * @param eventType - The event that should revoke the handler. - * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, - * asyncResult, which is an Office.AsyncResult object. - */ - removeHandlerAsync(eventType: Office.EventType | string, callback?: (asyncResult: Office.AsyncResult) => void): void; } /** * The compose mode of {@link Office.Item | Office.context.mailbox.item}. @@ -11924,531 +11868,14 @@ declare namespace Office { * **Important**: This is an internal Outlook object, not directly exposed through existing interfaces. * You should treat this as a mode of Office.context.mailbox.item. Refer to the * {@link https://docs.microsoft.com/office/dev/add-ins/reference/objectmodel/requirement-set-1.8/office.context.mailbox.item | Object Model} page for more information. + * + * Child interfaces: + * + * - {@link Office.AppointmentCompose | AppointmentCompose} + * + * - {@link Office.MessageCompose | MessageCompose} */ interface ItemCompose extends Item { - /** - * Gets or sets the description that appears in the subject field of an item. - * - * The subject property gets or sets the entire subject of the item, as sent by the email server. - * - * The subject property returns a Subject object that provides methods to get and set the subject. - * - * @remarks - * - * **{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}**: ReadItem - * - * **{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}**: Compose - */ - subject: Subject; - - /** - * Adds a file to a message or appointment as an attachment. - * - * The addFileAttachmentAsync method uploads the file at the specified URI and attaches it to the item in the compose form. - * - * You can subsequently use the identifier with the removeAttachmentAsync method to remove the attachment in the same session. - * - * [Api set: Mailbox 1.1] - * - * @remarks - * - * **{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}**: ReadWriteItem - * - * **{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}**: Compose - * - * **Errors**: - * - * - AttachmentSizeExceeded: The attachment is larger than allowed. - * - * - FileTypeNotSupported: The attachment has an extension that is not allowed. - * - * - NumberOfAttachmentsExceeded: The message or appointment has too many attachments. - * - * @param uri - The URI that provides the location of the file to attach to the message or appointment. The maximum length is 2048 characters. - * @param attachmentName - The name of the attachment that is shown while the attachment is uploading. The maximum length is 255 characters. - * @param options - Optional. An object literal that contains one or more of the following properties. - * asyncContext: Developers can provide any object they wish to access in the callback method. - * isInline: If true, indicates that the attachment will be shown inline in the message body, and should not be displayed in the - * attachment list. - * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of - * type Office.AsyncResult. On success, the attachment identifier will be provided in the asyncResult.value property. - * If uploading the attachment fails, the asyncResult object will contain an Error object that provides a description of - * the error. - */ - addFileAttachmentAsync(uri: string, attachmentName: string, options?: Office.AsyncContextOptions & { isInline: boolean }, callback?: (asyncResult: Office.AsyncResult) => void): void; - /** - * Adds a file to a message or appointment as an attachment. - * - * The addFileAttachmentAsync method uploads the file at the specified URI and attaches it to the item in the compose form. - * - * You can subsequently use the identifier with the removeAttachmentAsync method to remove the attachment in the same session. - * - * [Api set: Mailbox 1.1] - * - * @remarks - * - * **{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}**: ReadWriteItem - * - * **{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}**: Compose - * - * **Errors**: - * - * - AttachmentSizeExceeded: The attachment is larger than allowed. - * - * - FileTypeNotSupported: The attachment has an extension that is not allowed. - * - * - NumberOfAttachmentsExceeded: The message or appointment has too many attachments. - * - * @param uri - The URI that provides the location of the file to attach to the message or appointment. The maximum length is 2048 characters. - * @param attachmentName - The name of the attachment that is shown while the attachment is uploading. The maximum length is 255 characters. - * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of - * type Office.AsyncResult. On success, the attachment identifier will be provided in the asyncResult.value property. - * If uploading the attachment fails, the asyncResult object will contain an Error object that provides a description of - * the error. - */ - addFileAttachmentAsync(uri: string, attachmentName: string, callback?: (asyncResult: Office.AsyncResult) => void): void; - /** - * Adds a file to a message or appointment as an attachment. - * - * The addFileAttachmentFromBase64Async method uploads the file from the base64 encoding and attaches it to the item in the compose form. - * This method returns the attachment identifier in the asyncResult.value object. - * - * You can subsequently use the identifier with the removeAttachmentAsync method to remove the attachment in the same session. - * - * **Note**: If you're using a data URL API (e.g., readAsDataURL), you need to strip out the data URL prefix then send the rest of the string to this API. - * For example, if the full string is represented by `data:image/svg+xml;base64,`, remove `data:image/svg+xml;base64,`. - * - * [Api set: Mailbox 1.8] - * - * @remarks - * - * **{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}**: ReadWriteItem - * - * **{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}**: Compose - * - * **Errors**: - * - * - AttachmentSizeExceeded: The attachment is larger than allowed. - * - * - FileTypeNotSupported: The attachment has an extension that is not allowed. - * - * - NumberOfAttachmentsExceeded: The message or appointment has too many attachments. - * - * @param base64File - The base64 encoded content of an image or file to be added to an email or event. - * @param attachmentName - The name of the attachment that is shown while the attachment is uploading. The maximum length is 255 characters. - * @param options - Optional. An object literal that contains one or more of the following properties. - * asyncContext: Developers can provide any object they wish to access in the callback method. - * isInline: If true, indicates that the attachment will be shown inline in the message body and should not be displayed in the attachment list. - * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type Office.AsyncResult. - * On success, the attachment identifier will be provided in the asyncResult.value property. - * If uploading the attachment fails, the asyncResult object will contain an Error object that provides a description of the error. - */ - addFileAttachmentFromBase64Async(base64File: string, attachmentName: string, options?: Office.AsyncContextOptions & { isInline: boolean }, callback?: (asyncResult: Office.AsyncResult) => void): void; - /** - * Adds a file to a message or appointment as an attachment. - * - * The addFileAttachmentFromBase64Async method uploads the file from the base64 encoding and attaches it to the item in the compose form. - * This method returns the attachment identifier in the asyncResult.value object. - * - * You can subsequently use the identifier with the removeAttachmentAsync method to remove the attachment in the same session. - * - * **Note**: If you're using a data URL API (e.g., readAsDataURL), you need to strip out the data URL prefix then send the rest of the string to this API. - * For example, if the full string is represented by `data:image/svg+xml;base64,`, remove `data:image/svg+xml;base64,`. - * - * [Api set: Mailbox 1.8] - * - * @remarks - * - * **{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}**: ReadWriteItem - * - * **{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}**: Compose - * - * **Errors**: - * - * - AttachmentSizeExceeded: The attachment is larger than allowed. - * - * - FileTypeNotSupported: The attachment has an extension that is not allowed. - * - * - NumberOfAttachmentsExceeded: The message or appointment has too many attachments. - * - * @param base64File - The base64 encoded content of an image or file to be added to an email or event. - * @param attachmentName - The name of the attachment that is shown while the attachment is uploading. The maximum length is 255 characters. - * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type Office.AsyncResult. - * On success, the attachment identifier will be provided in the asyncResult.value property. - * If uploading the attachment fails, the asyncResult object will contain an Error object that provides a description of the error. - */ - addFileAttachmentFromBase64Async(base64File: string, attachmentName: string, callback?: (asyncResult: Office.AsyncResult) => void): void; - /** - * Adds an Exchange item, such as a message, as an attachment to the message or appointment. - * - * The addItemAttachmentAsync method attaches the item with the specified Exchange identifier to the item in the compose form. - * If you specify a callback method, the method is called with one parameter, asyncResult, which contains either the attachment identifier or - * a code that indicates any error that occurred while attaching the item. You can use the options parameter to pass state information to the - * callback method, if needed. - * - * You can subsequently use the identifier with the removeAttachmentAsync method to remove the attachment in the same session. - * - * If your Office add-in is running in Outlook on the web, the addItemAttachmentAsync method can attach items to items other than the item that - * you are editing; however, this is not supported and is not recommended. - * - * [Api set: Mailbox 1.1] - * - * @remarks - * - * **{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}**: ReadWriteItem - * - * **{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}**: Compose - * - * **Errors**: - * - * - NumberOfAttachmentsExceeded: The message or appointment has too many attachments. - * - * @param itemId - The Exchange identifier of the item to attach. The maximum length is 100 characters. - * @param attachmentName - The name of the attachment that is shown while the attachment is uploading. The maximum length is 255 characters. - * @param options - Optional. An object literal that contains one or more of the following properties. - * asyncContext: Developers can provide any object they wish to access in the callback method. - * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of - * type Office.AsyncResult. On success, the attachment identifier will be provided in the asyncResult.value property. - * If adding the attachment fails, the asyncResult object will contain an Error object that provides a description of - * the error. - */ - addItemAttachmentAsync(itemId: any, attachmentName: string, options?: Office.AsyncContextOptions, callback?: (asyncResult: Office.AsyncResult) => void): void; - /** - * Adds an Exchange item, such as a message, as an attachment to the message or appointment. - * - * The addItemAttachmentAsync method attaches the item with the specified Exchange identifier to the item in the compose form. - * If you specify a callback method, the method is called with one parameter, asyncResult, which contains either the attachment identifier or - * a code that indicates any error that occurred while attaching the item. You can use the options parameter to pass state information to the - * callback method, if needed. - * - * You can subsequently use the identifier with the removeAttachmentAsync method to remove the attachment in the same session. - * - * If your Office add-in is running in Outlook on the web, the addItemAttachmentAsync method can attach items to items other than the item that - * you are editing; however, this is not supported and is not recommended. - * - * [Api set: Mailbox 1.1] - * - * @remarks - * - * **{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}**: ReadWriteItem - * - * **{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}**: Compose - * - * **Errors**: - * - * - NumberOfAttachmentsExceeded: The message or appointment has too many attachments. - * - * @param itemId - The Exchange identifier of the item to attach. The maximum length is 100 characters. - * @param attachmentName - The name of the attachment that is shown while the attachment is uploading. The maximum length is 255 characters. - * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of - * type Office.AsyncResult. On success, the attachment identifier will be provided in the asyncResult.value property. - * If adding the attachment fails, the asyncResult object will contain an Error object that provides a description of - * the error. - */ - addItemAttachmentAsync(itemId: any, attachmentName: string, callback?: (asyncResult: Office.AsyncResult) => void): void; - /** - * Closes the current item that is being composed - * - * The behaviors of the close method depends on the current state of the item being composed. - * If the item has unsaved changes, the client prompts the user to save, discard, or close the action. - * - * In the Outlook desktop client, if the message is an inline reply, the close method has no effect. - * - * **Note**: In Outlook on the web, if the item is an appointment and it has previously been saved using saveAsync, the user is prompted to save, - * discard, or cancel even if no changes have occurred since the item was last saved. - * - * [Api set: Mailbox 1.3] - * - * @remarks - * - * **{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}**: Restricted - * - * **{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}**: Compose - */ - close(): void; - /** - * Gets the item's attachments as an array. - * - * [Api set: Mailbox 1.8] - * - * @remarks - * - * **{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}**: ReadItem - * - * **{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}**: Compose - * - * @param options - Optional. An object literal that contains one or more of the following properties. - * asyncContext: Developers can provide any object they wish to access in the callback method. - * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of - * type Office.AsyncResult. If the call fails, the asyncResult.error property will contain and error code with the reason for - * the failure. - */ - getAttachmentsAsync(options?: Office.AsyncContextOptions, callback?: (asyncResult: Office.AsyncResult) => void): void; - /** - * Gets the item's attachments as an array. - * - * [Api set: Mailbox 1.8] - * - * @remarks - * - * **{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}**: ReadItem - * - * **{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}**: Compose - * - * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of - * type Office.AsyncResult. If the call fails, the asyncResult.error property will contain and error code with the reason for - * the failure. - */ - getAttachmentsAsync(callback?: (asyncResult: Office.AsyncResult) => void): void; - /** - * Asynchronously returns selected data from the subject or body of a message. - * - * If there is no selection but the cursor is in the body or subject, the method returns an empty string for the selected data. - * If a field other than the body or subject is selected, the method returns the InvalidSelection error. - * - * To access the selected data from the callback method, call asyncResult.value.data. - * To access the source property that the selection comes from, call asyncResult.value.sourceProperty, which will be either body or subject. - * - * [Api set: Mailbox 1.2] - * - * @returns - * The selected data as a string with format determined by coercionType. - * - * @remarks - * - * **{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}**: ReadItem - * - * **{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}**: Compose - * - * @param coercionType - Requests a format for the data. If Text, the method returns the plain text as a string, removing any HTML tags present. - * If HTML, the method returns the selected text, whether it is plaintext or HTML. - * @param options - An object literal that contains one or more of the following properties. - * asyncContext: Developers can provide any object they wish to access in the callback method. - * @param callback - When the method completes, the function passed in the callback parameter is called with a single parameter of - * type Office.AsyncResult. - */ - getSelectedDataAsync(coercionType: Office.CoercionType | string, options: Office.AsyncContextOptions, callback: (asyncResult: Office.AsyncResult) => void): void; - /** - * Asynchronously returns selected data from the subject or body of a message. - * - * If there is no selection but the cursor is in the body or subject, the method returns an empty string for the selected data. - * If a field other than the body or subject is selected, the method returns the InvalidSelection error. - * - * To access the selected data from the callback method, call asyncResult.value.data. - * To access the source property that the selection comes from, call asyncResult.value.sourceProperty, which will be either body or subject. - * - * [Api set: Mailbox 1.2] - * - * @returns - * The selected data as a string with format determined by coercionType. - * - * @remarks - * - * **{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}**: ReadItem - * - * **{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}**: Compose - * - * @param coercionType - Requests a format for the data. If Text, the method returns the plain text as a string , removing any HTML tags present. - * If HTML, the method returns the selected text, whether it is plaintext or HTML. - * @param callback - When the method completes, the function passed in the callback parameter is called with a single parameter of - * type Office.AsyncResult. - */ - getSelectedDataAsync(coercionType: Office.CoercionType | string, callback: (asyncResult: Office.AsyncResult) => void): void; - /** - * Removes an attachment from a message or appointment. - * - * The removeAttachmentAsync method removes the attachment with the specified identifier from the item. - * As a best practice, you should use the attachment identifier to remove an attachment only if the same mail app has added that attachment - * in the same session. In Outlook on the web and mobile devices, the attachment identifier is valid only within the same session. - * A session is over when the user closes the app, or if the user starts composing an inline form then subsequently pops out the form to - * continue in a separate window. - * - * [Api set: Mailbox 1.1] - * - * @remarks - * - * **{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}**: ReadWriteItem - * - * **{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}**: Compose - * - * **Errors**: - * - * - InvalidAttachmentId: The attachment identifier does not exist. - * - * @param attachmentId - The identifier of the attachment to remove. - * @param options - Optional. An object literal that contains one or more of the following properties. - * asyncContext: Developers can provide any object they wish to access in the callback method. - * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of - * type Office.AsyncResult. - * If removing the attachment fails, the asyncResult.error property will contain an error code with the reason for the failure. - */ - removeAttachmentAsync(attachmentId: string, options?: Office.AsyncContextOptions, callback?: (asyncResult: Office.AsyncResult) => void): void; - /** - * Removes an attachment from a message or appointment. - * - * The removeAttachmentAsync method removes the attachment with the specified identifier from the item. - * As a best practice, you should use the attachment identifier to remove an attachment only if the same mail app has added that attachment - * in the same session. In Outlook on the web and mobile devices, the attachment identifier is valid only within the same session. - * A session is over when the user closes the app, or if the user starts composing an inline form then subsequently pops out the form to - * continue in a separate window. - * - * [Api set: Mailbox 1.1] - * - * @remarks - * - * **{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}**: ReadWriteItem - * - * **{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}**: Compose - * - * **Errors**: - * - * - InvalidAttachmentId: The attachment identifier does not exist. - * - * @param attachmentId - The identifier of the attachment to remove. - * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of - * type Office.AsyncResult. - * If removing the attachment fails, the asyncResult.error property will contain an error code with the reason for the failure. - */ - removeAttachmentAsync(attachmentId: string, callback?: (asyncResult: Office.AsyncResult) => void): void; - /** - * Asynchronously saves an item. - * - * When invoked, this method saves the current message as a draft and returns the item id via the callback method. - * In Outlook on the web or Outlook in online mode, the item is saved to the server. - * In Outlook in cached mode, the item is saved to the local cache. - * - * Since appointments have no draft state, if saveAsync is called on an appointment in compose mode, the item will be saved as a normal - * appointment on the user's calendar. For new appointments that have not been saved before, no invitation will be sent. - * Saving an existing appointment will send an update to added or removed attendees. - * - * **Note**: If your add-in calls saveAsync on an item in compose mode in order to get an itemId to use with EWS or the REST API, be aware that - * when Outlook is in cached mode, it may take some time before the item is actually synced to the server. - * Until the item is synced, using the itemId will return an error. - * - * **Note**: The following clients have different behavior for saveAsync on appointments in compose mode: - * - * - Outlook on Mac does not support saving a meeting. The saveAsync method fails when called from a meeting in compose mode. - * See {@link https://support.microsoft.com/help/4505745 | Cannot save a meeting as a draft in Outlook for Mac by using Office JS API} for a workaround. - * - * - Outlook on the web always sends an invitation or update when saveAsync is called on an appointment in compose mode. - * - * [Api set: Mailbox 1.3] - * - * @remarks - * - * **{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}**: ReadWriteItem - * - * **{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}**: Compose - * - * **Errors**: - * - * - InvalidAttachmentId: The attachment identifier does not exist. - * - * @param options - An object literal that contains one or more of the following properties. - * asyncContext: Developers can provide any object they wish to access in the callback method. - * @param callback - When the method completes, the function passed in the callback parameter is called with a single parameter of - * type Office.AsyncResult. - * If removing the attachment fails, the asyncResult.error property will contain an error code with the reason for the failure. - */ - saveAsync(options: Office.AsyncContextOptions, callback: (asyncResult: Office.AsyncResult) => void): void; - /** - * Asynchronously saves an item. - * - * When invoked, this method saves the current message as a draft and returns the item id via the callback method. - * In Outlook on the web or Outlook in online mode, the item is saved to the server. - * In Outlook in cached mode, the item is saved to the local cache. - * - * Since appointments have no draft state, if saveAsync is called on an appointment in compose mode, the item will be saved as a normal - * appointment on the user's calendar. For new appointments that have not been saved before, no invitation will be sent. - * Saving an existing appointment will send an update to added or removed attendees. - * - * **Note**: If your add-in calls saveAsync on an item in compose mode in order to get an itemId to use with EWS or the REST API, be aware that - * when Outlook is in cached mode, it may take some time before the item is actually synced to the server. - * Until the item is synced, using the itemId will return an error. - * - * **Note**: The following clients have different behavior for saveAsync on appointments in compose mode: - * - * - Outlook on Mac does not support saving a meeting. The saveAsync method fails when called from a meeting in compose mode. - * See {@link https://support.microsoft.com/help/4505745 | Cannot save a meeting as a draft in Outlook for Mac by using Office JS API} for a workaround. - * - * - Outlook on the web always sends an invitation or update when saveAsync is called on an appointment in compose mode. - * - * [Api set: Mailbox 1.3] - * - * @remarks - * - * **{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}**: ReadWriteItem - * - * **{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}**: Compose - * - * **Errors**: - * - * - InvalidAttachmentId: The attachment identifier does not exist. - * - * @param callback - When the method completes, the function passed in the callback parameter is called with a single parameter of - * type Office.AsyncResult. - * If removing the attachment fails, the asyncResult.error property will contain an error code with the reason for the failure. - */ - saveAsync(callback: (asyncResult: Office.AsyncResult) => void): void; - /** - * Asynchronously inserts data into the body or subject of a message. - * - * The setSelectedDataAsync method inserts the specified string at the cursor location in the subject or body of the item, or, if text is - * selected in the editor, it replaces the selected text. If the cursor is not in the body or subject field, an error is returned. - * After insertion, the cursor is placed at the end of the inserted content. - * - * [Api set: Mailbox 1.2] - * - * @remarks - * - * **{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}**: ReadWriteItem - * - * **{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}**: Compose - * - * **Errors**: - * - * - InvalidAttachmentId: The attachment identifier does not exist. - * - * @param data - The data to be inserted. Data is not to exceed 1,000,000 characters. - * If more than 1,000,000 characters are passed in, an ArgumentOutOfRange exception is thrown. - * @param options - Optional. An object literal that contains one or more of the following properties. - * asyncContext: Developers can provide any object they wish to access in the callback method. - * coercionType: If text, the current style is applied in Outlook on the web and desktop clients. - * If the field is an HTML editor, only the text data is inserted, even if the data is HTML. - * If html and the field supports HTML (the subject doesn't), the current style is applied in Outlook on the web and the default style is - * applied in Outlook on desktop clients. - * If the field is a text field, an InvalidDataFormat error is returned. - * If coercionType is not set, the result depends on the field: if the field is HTML then HTML is used; - * if the field is text, then plain text is used. - * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of - * type Office.AsyncResult. - */ - setSelectedDataAsync(data: string, options?: Office.AsyncContextOptions & CoercionTypeOptions, callback?: (asyncResult: Office.AsyncResult) => void): void; - /** - * Asynchronously inserts data into the body or subject of a message. - * - * The setSelectedDataAsync method inserts the specified string at the cursor location in the subject or body of the item, or, if text is - * selected in the editor, it replaces the selected text. If the cursor is not in the body or subject field, an error is returned. - * After insertion, the cursor is placed at the end of the inserted content. - * - * [Api set: Mailbox 1.2] - * - * @remarks - * - * **{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}**: ReadWriteItem - * - * **{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}**: Compose - * - * **Errors**: - * - * - InvalidAttachmentId: The attachment identifier does not exist. - * - * @param data - The data to be inserted. Data is not to exceed 1,000,000 characters. - * If more than 1,000,000 characters are passed in, an ArgumentOutOfRange exception is thrown. - * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of - * type Office.AsyncResult. - */ - setSelectedDataAsync(data: string, callback?: (asyncResult: Office.AsyncResult) => void): void; } /** * The read mode of {@link Office.Item | Office.context.mailbox.item}. @@ -12456,351 +11883,14 @@ declare namespace Office { * **Important**: This is an internal Outlook object, not directly exposed through existing interfaces. * You should treat this as a mode of Office.context.mailbox.item. Refer to the * {@link https://docs.microsoft.com/office/dev/add-ins/reference/objectmodel/requirement-set-1.8/office.context.mailbox.item | Object Model} page for more information. + * + * Child interfaces: + * + * - {@link Office.AppointmentRead | AppointmentRead} + * + * - {@link Office.MessageRead | MessageRead} */ interface ItemRead extends Item { - /** - * Gets the item's attachments as an array. - * - * @remarks - * - * **{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}**: ReadItem - * - * **{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}**: Read - * - * **Note**: Certain types of files are blocked by Outlook due to potential security issues and are therefore not returned. - * For more information, see - * {@link https://support.office.com/article/Blocked-attachments-in-Outlook-434752E1-02D3-4E90-9124-8B81E49A8519 | Blocked attachments in Outlook}. - * - */ - attachments: AttachmentDetails[]; - /** - * Gets the Exchange Web Services item class of the selected item. - * - * - * You can create custom message classes that extends a default message class, for example, a custom appointment message class - * IPM.Appointment.Contoso. - * - * @remarks - * - * **{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}**: ReadItem - * - * **{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}**: Read - * - * The itemClass property specifies the message class of the selected item. The following are the default message classes for the message or - * appointment item. - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
TypeDescriptionItem Class
Appointment itemsThese are calendar items of the item class IPM.Appointment or IPM.Appointment.Occurrence.IPM.Appointment,IPM.Appointment.Occurrence
Message itemsThese include email messages that have the default message class IPM.Note, and meeting requests, responses, and cancellations, that use IPM.Schedule.Meeting as the base message class.IPM.Note,IPM.Schedule.Meeting.Request,IPM.Schedule.Meeting.Neg,IPM.Schedule.Meeting.Pos,IPM.Schedule.Meeting.Tent,IPM.Schedule.Meeting.Canceled
- */ - itemClass: string; - /** - * Gets the {@link https://docs.microsoft.com/exchange/client-developer/exchange-web-services/ews-identifiers-in-exchange | Exchange Web Services item identifier} - * for the current item. - * - * The itemId property is not available in compose mode. - * If an item identifier is required, the saveAsync method can be used to save the item to the store, which will return the item identifier - * in the asyncResult.value parameter in the callback function. - * - * **Note**: The identifier returned by the itemId property is the same as the - * {@link https://docs.microsoft.com/exchange/client-developer/exchange-web-services/ews-identifiers-in-exchange | Exchange Web Services item identifier}. - * The itemId property is not identical to the Outlook Entry ID or the ID used by the Outlook REST API. - * Before making REST API calls using this value, it should be converted using Office.context.mailbox.convertToRestId. - * For more details, see {@link https://docs.microsoft.com/outlook/add-ins/use-rest-api#get-the-item-id | Use the Outlook REST APIs from an Outlook add-in}. - * - * @remarks - * - * **{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}**: ReadItem - * - * **{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}**: Read - */ - itemId: string; - /** - * Gets the subject of an item, with all prefixes removed (including RE: and FWD:). - * - * The normalizedSubject property gets the subject of the item, with any standard prefixes (such as RE: and FW:) that are added by - * email programs. To get the subject of the item with the prefixes intact, use the subject property. - * - * @remarks - * - * **{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}**: ReadItem - * - * **{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}**: Read - */ - normalizedSubject: string; - /** - * Gets the description that appears in the subject field of an item. - * - * The subject property gets or sets the entire subject of the item, as sent by the email server. - * - * The subject property returns a string. Use the normalizedSubject property to get the subject minus any leading prefixes such as RE: and FW:. - * - * @remarks - * - * **{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}**: ReadItem - * - * **{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}**: Read - */ - subject: string; - - /** - * Displays a reply form that includes the sender and all recipients of the selected message or the organizer and all attendees of the - * selected appointment. - * - * In Outlook on the web, the reply form is displayed as a pop-out form in the 3-column view and a pop-up form in the 2- or 1-column view. - * - * If any of the string parameters exceed their limits, displayReplyAllForm throws an exception. - * - * When attachments are specified in the formData.attachments parameter, Outlook on the web and desktop clients attempt to download all attachments and - * attach them to the reply form. If any attachments fail to be added, an error is shown in the form UI. - * If this isn't possible, then no error message is thrown. - * - * **Note**: This method is not supported in Outlook on iOS or Android. - * - * @remarks - * - * **{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}**: ReadItem - * - * **{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}**: Read - * - * @param formData - A string that contains text and HTML and that represents the body of the reply form. The string is limited to 32 KB - * OR a {@link Office.ReplyFormData | ReplyFormData} object that contains body or attachment data and a callback function. - * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, - * asyncResult, which is an Office.AsyncResult object. - */ - displayReplyAllForm(formData: string | ReplyFormData, callback?: (asyncResult: Office.AsyncResult) => void): void; - /** - * Displays a reply form that includes only the sender of the selected message or the organizer of the selected appointment. - * - * In Outlook on the web, the reply form is displayed as a pop-out form in the 3-column view and a pop-up form in the 2- or 1-column view. - * - * If any of the string parameters exceed their limits, displayReplyForm throws an exception. - * - * When attachments are specified in the formData.attachments parameter, Outlook on the web and desktop clients attempt to download all attachments and - * attach them to the reply form. If any attachments fail to be added, an error is shown in the form UI. - * If this isn't possible, then no error message is thrown. - * - * **Note**: This method is not supported in Outlook on iOS or Android. - * - * @remarks - * - * **{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}**: ReadItem - * - * **{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}**: Read - * - * @param formData - A string that contains text and HTML and that represents the body of the reply form. The string is limited to 32 KB - * OR a {@link Office.ReplyFormData | ReplyFormData} object that contains body or attachment data and a callback function. - * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, - * asyncResult, which is an Office.AsyncResult object. - */ - displayReplyForm(formData: string | ReplyFormData, callback?: (asyncResult: Office.AsyncResult) => void): void; - /** - * Gets the entities found in the selected item's body. - * - * **Note**: This method is not supported in Outlook on iOS or Android. - * - * @remarks - * - * **{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}**: ReadItem - * - * **{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}**: Read - */ - getEntities(): Entities; - /** - * Gets an array of all the entities of the specified entity type found in the selected item's body. - * - * **Note**: This method is not supported in Outlook on iOS or Android. - * - * @param entityType - One of the EntityType enumeration values. - * - * @returns - * If the value passed in entityType is not a valid member of the EntityType enumeration, the method returns null. - * If no entities of the specified type are present in the item's body, the method returns an empty array. - * Otherwise, the type of the objects in the returned array depends on the type of entity requested in the entityType parameter. - * - * @remarks - * - * **{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}**: Restricted - * - * **{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}**: Read - * - * While the minimum permission level to use this method is Restricted, some entity types require ReadItem to access, as specified in the - * following table. - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Value of entityTypeType of objects in returned arrayRequired Permission Level
AddressStringRestricted
ContactContactReadItem
EmailAddressStringReadItem
MeetingSuggestionMeetingSuggestionReadItem
PhoneNumberPhoneNumberRestricted
TaskSuggestionTaskSuggestionReadItem
URLStringRestricted
- */ - getEntitiesByType(entityType: MailboxEnums.EntityType | string): (string | Contact | MeetingSuggestion | PhoneNumber | TaskSuggestion)[]; - /** - * Returns well-known entities in the selected item that pass the named filter defined in the manifest XML file. - * - * The getFilteredEntitiesByName method returns the entities that match the regular expression defined in the ItemHasKnownEntity rule element - * in the manifest XML file with the specified FilterName element value. - * - * **Note**: This method is not supported in Outlook on iOS or Android. - * - * @remarks - * - * **{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}**: ReadItem - * - * **{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}**: Read - * - * @param name - The name of the ItemHasKnownEntity rule element that defines the filter to match. - * @returns If there is no ItemHasKnownEntity element in the manifest with a FilterName element value that matches the name parameter, - * the method returns null. - * If the name parameter does match an ItemHasKnownEntity element in the manifest, but there are no entities in the current item that match, - * the method return an empty array. - */ - getFilteredEntitiesByName(name: string): (string | Contact | MeetingSuggestion | PhoneNumber | TaskSuggestion)[]; - /** - * Returns string values in the selected item that match the regular expressions defined in the manifest XML file. - * - * The getRegExMatches method returns the strings that match the regular expression defined in each ItemHasRegularExpressionMatch or - * ItemHasKnownEntity rule element in the manifest XML file. - * For an ItemHasRegularExpressionMatch rule, a matching string has to occur in the property of the item that is specified by that rule. - * The PropertyName simple type defines the supported properties. - * - * If you specify an ItemHasRegularExpressionMatch rule on the body property of an item, the regular expression should further filter the body - * and should not attempt to return the entire body of the item. - * Using a regular expression such as .* to obtain the entire body of an item does not always return the expected results. - * Instead, use the Body.getAsync method to retrieve the entire body. - * - * **Note**: This method is not supported in Outlook on iOS or Android. - * - * @returns - * An object that contains arrays of strings that match the regular expressions defined in the manifest XML file. - * The name of each array is equal to the corresponding value of the RegExName attribute of the matching ItemHasRegularExpressionMatch rule - * or the FilterName attribute of the matching ItemHasKnownEntity rule. - * - * @remarks - * - * **{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}**: ReadItem - * - * **{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}**: Read - */ - getRegExMatches(): any; - /** - * Returns string values in the selected item that match the named regular expression defined in the manifest XML file. - * - * The getRegExMatchesByName method returns the strings that match the regular expression defined in the ItemHasRegularExpressionMatch rule - * element in the manifest XML file with the specified RegExName element value. - * - * If you specify an ItemHasRegularExpressionMatch rule on the body property of an item, the regular expression should further filter the body - * and should not attempt to return the entire body of the item. - * Using a regular expression such as .* to obtain the entire body of an item does not always return the expected results. - * - * **Note**: This method is not supported in Outlook on iOS or Android. - * - * @returns - * An array that contains the strings that match the regular expression defined in the manifest XML file. - * - * @remarks - * - * **{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}**: ReadItem - * - * **{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}**: Read - * - * @param name - The name of the ItemHasRegularExpressionMatch rule element that defines the filter to match. - */ - getRegExMatchesByName(name: string): string[]; - /** - * Gets the entities found in a highlighted match a user has selected. Highlighted matches apply to contextual add-ins. - * - * **Note**: This method is not supported in Outlook on iOS or Android. - * - * [Api set: Mailbox 1.6] - * - * @remarks - * - * **{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}**: ReadItem - * - * **{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}**: Read - * - * @param name - The name of the ItemHasRegularExpressionMatch rule element that defines the filter to match. - */ - getSelectedEntities(): Entities; - /** - * Returns string values in a highlighted match that match the regular expressions defined in the manifest XML file. - * Highlighted matches apply to contextual add-ins. - * - * The getSelectedRegExMatches method returns the strings that match the regular expression defined in each ItemHasRegularExpressionMatch or - * ItemHasKnownEntity rule element in the manifest XML file. For an ItemHasRegularExpressionMatch rule, a matching string has to occur in the property of the item that is specified by that rule. The PropertyName simple type defines the supported properties. - * - * If you specify an ItemHasRegularExpressionMatch rule on the body property of an item, the regular expression should further filter the body - * and should not attempt to return the entire body of the item. - * Using a regular expression such as .* to obtain the entire body of an item does not always return the expected results. - * Instead, use the Body.getAsync method to retrieve the entire body. - * - * **Note**: This method is not supported in Outlook on iOS or Android. - * - * [Api set: Mailbox 1.6] - * - * @returns - * An object that contains arrays of strings that match the regular expressions defined in the manifest XML file. - * The name of each array is equal to the corresponding value of the RegExName attribute of the matching ItemHasRegularExpressionMatch rule - * or the FilterName attribute of the matching ItemHasKnownEntity rule. - * - * @remarks - * - * **{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}**: ReadItem - * - * **{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}**: Read - */ - getSelectedRegExMatches(): any; } /** * Represents a date and time in the local client's time zone. Read mode only. @@ -13757,25 +12847,14 @@ declare namespace Office { * **Important**: This is an internal Outlook object, not directly exposed through existing interfaces. * You should treat this as a mode of Office.context.mailbox.item. Refer to the * {@link https://docs.microsoft.com/office/dev/add-ins/reference/objectmodel/requirement-set-1.8/office.context.mailbox.item | Object Model} page for more information. + * + * Child interfaces: + * + * - {@link Office.MessageCompose | MessageCompose} + * + * - {@link Office.MessageRead | MessageRead} */ interface Message extends Item { - /** - * Gets an identifier for the email conversation that contains a particular message. - * - * You can get an integer for this property if your mail app is activated in read forms or responses in compose forms. - * If subsequently the user changes the subject of the reply message, upon sending the reply, the conversation ID for that message will - * change and that value you obtained earlier will no longer apply. - * - * You get null for this property for a new item in a compose form. - * If the user sets a subject and saves the item, the conversationId property will return a value. - * - * @remarks - * - * **{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}**: ReadItem - * - * **{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}**: Compose or Read - */ - conversationId: string; } /** * The message compose mode of {@link Office.Item | Office.context.mailbox.item}. @@ -13783,6 +12862,12 @@ declare namespace Office { * **Important**: This is an internal Outlook object, not directly exposed through existing interfaces. * You should treat this as a mode of Office.context.mailbox.item. Refer to the * {@link https://docs.microsoft.com/office/dev/add-ins/reference/objectmodel/requirement-set-1.8/office.context.mailbox.item | Object Model} page for more information. + * + * Parent interfaces: + * + * - {@link Office.ItemCompose | ItemCompose} + * + * - {@link Office.Message | Message} */ interface MessageCompose extends Message, ItemCompose { /** @@ -14241,6 +13326,62 @@ declare namespace Office { * **{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}**: Message Compose */ close(): void; + /** + * Gets an attachment from a message or appointment and returns it as an **AttachmentContent** object. + * + * The `getAttachmentContentAsync` method gets the attachment with the specified identifier from the item. As a best practice, you should use + * the identifier to retrieve an attachment in the same session that the attachmentIds were retrieved with the `getAttachmentsAsync` or + * `item.attachments` call. In Outlook on the web and mobile devices, the attachment identifier is valid only within the same session. + * A session is over when the user closes the app, or if the user starts composing an inline form then subsequently pops out the form to + * continue in a separate window. + * + * [Api set: Mailbox 1.8] + * + * @remarks + * + * **{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}**: ReadItem + * + * **{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}**: Message Compose + * + * **Errors**: + * + * - InvalidAttachmentId: The attachment identifier does not exist. + * + * @param attachmentId - The identifier of the attachment you want to get. + * @param options - Optional. An object literal that contains one or more of the following properties. + * asyncContext: Developers can provide any object they wish to access in the callback method. + * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, + * asyncResult, which is an Office.AsyncResult object. If the call fails, the asyncResult.error property will contain and error code + * with the reason for the failure. + */ + getAttachmentContentAsync(attachmentId: string, options?: Office.AsyncContextOptions, callback?: (asyncResult: Office.AsyncResult) => void): void; + /** + * Gets an attachment from a message or appointment and returns it as an **AttachmentContent** object. + * + * The `getAttachmentContentAsync` method gets the attachment with the specified identifier from the item. As a best practice, you should use + * the identifier to retrieve an attachment in the same session that the attachmentIds were retrieved with the `getAttachmentsAsync` or + * `item.attachments` call. In Outlook on the web and mobile devices, the attachment identifier is valid only within the same session. + * A session is over when the user closes the app, or if the user starts composing an inline form then subsequently pops out the form to + * continue in a separate window. + * + * [Api set: Mailbox 1.8] + * + * @remarks + * + * **{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}**: ReadItem + * + * **{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}**: Message Compose + * + * **Errors**: + * + * - InvalidAttachmentId: The attachment identifier does not exist. + * + * @param attachmentId - The identifier of the attachment you want to get. + * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, + * asyncResult, which is an Office.AsyncResult object. If the call fails, the asyncResult.error property will contain and error code + * with the reason for the failure. + */ + getAttachmentContentAsync(attachmentId: string, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Gets the item's attachments as an array. * @@ -14379,6 +13520,40 @@ declare namespace Office { * @param callback - When the method completes, the function passed in the callback parameter is called with a single parameter of type Office.AsyncResult. */ getItemIdAsync(callback: (asyncResult: Office.AsyncResult) => void): void; + /** + * Gets the properties of an appointment or message in a shared folder, calendar, or mailbox. + * + * [Api set: Mailbox 1.8] + * + * @remarks + * + * **{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}**: ReadItem + * + * **{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}**: Message Compose + * + * @param options - An object literal that contains one or more of the following properties. + * asyncContext: Developers can provide any object they wish to access in the callback method. + * @param callback - When the method completes, the function passed in the callback parameter is called with a single parameter of + * type Office.AsyncResult. + * The `value` property of the result is the properties of the shared item. + */ + getSharedPropertiesAsync(options: Office.AsyncContextOptions, callback: (asyncResult: Office.AsyncResult) => void): void; + /** + * Gets the properties of an appointment or message in a shared folder, calendar, or mailbox. + * + * [Api set: Mailbox 1.8] + * + * @remarks + * + * **{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}**: ReadItem + * + * **{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}**: Message Compose + * + * @param callback - When the method completes, the function passed in the callback parameter is called with a single parameter of + * type Office.AsyncResult. + * The `value` property of the result is the properties of the shared item. + */ + getSharedPropertiesAsync(callback: (asyncResult: Office.AsyncResult) => void): void; /** * Asynchronously loads custom properties for this add-in on the selected item. * @@ -14639,6 +13814,12 @@ declare namespace Office { * **Important**: This is an internal Outlook object, not directly exposed through existing interfaces. * You should treat this as a mode of Office.context.mailbox.item. Refer to the * {@link https://docs.microsoft.com/office/dev/add-ins/reference/objectmodel/requirement-set-1.8/office.context.mailbox.item | Object Model} page for more information. + * + * Parent interfaces: + * + * - {@link Office.ItemRead | ItemRead} + * + * - {@link Office.Message | Message} */ interface MessageRead extends Message, ItemRead { /** @@ -15116,6 +14297,62 @@ declare namespace Office { * If the call fails, the asyncResult.error property will contain an error code with the reason for the failure. */ getAllInternetHeadersAsync(callback?: (asyncResult: Office.AsyncResult) => void): void; + /** + * Gets an attachment from a message or appointment and returns it as an **AttachmentContent** object. + * + * The `getAttachmentContentAsync` method gets the attachment with the specified identifier from the item. As a best practice, you should use + * the identifier to retrieve an attachment in the same session that the attachmentIds were retrieved with the `getAttachmentsAsync` or + * `item.attachments` call. In Outlook on the web and mobile devices, the attachment identifier is valid only within the same session. + * A session is over when the user closes the app, or if the user starts composing an inline form then subsequently pops out the form to + * continue in a separate window. + * + * [Api set: Mailbox 1.8] + * + * @remarks + * + * **{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}**: ReadItem + * + * **{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}**: Message Read + * + * **Errors**: + * + * - InvalidAttachmentId: The attachment identifier does not exist. + * + * @param attachmentId - The identifier of the attachment you want to get. + * @param options - Optional. An object literal that contains one or more of the following properties. + * asyncContext: Developers can provide any object they wish to access in the callback method. + * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, + * asyncResult, which is an Office.AsyncResult object. If the call fails, the asyncResult.error property will contain and error code + * with the reason for the failure. + */ + getAttachmentContentAsync(attachmentId: string, options?: Office.AsyncContextOptions, callback?: (asyncResult: Office.AsyncResult) => void): void; + /** + * Gets an attachment from a message or appointment and returns it as an **AttachmentContent** object. + * + * The `getAttachmentContentAsync` method gets the attachment with the specified identifier from the item. As a best practice, you should use + * the identifier to retrieve an attachment in the same session that the attachmentIds were retrieved with the `getAttachmentsAsync` or + * `item.attachments` call. In Outlook on the web and mobile devices, the attachment identifier is valid only within the same session. + * A session is over when the user closes the app, or if the user starts composing an inline form then subsequently pops out the form to + * continue in a separate window. + * + * [Api set: Mailbox 1.8] + * + * @remarks + * + * **{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}**: ReadItem + * + * **{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}**: Message Read + * + * **Errors**: + * + * - InvalidAttachmentId: The attachment identifier does not exist. + * + * @param attachmentId - The identifier of the attachment you want to get. + * @param callback - Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, + * asyncResult, which is an Office.AsyncResult object. If the call fails, the asyncResult.error property will contain and error code + * with the reason for the failure. + */ + getAttachmentContentAsync(attachmentId: string, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Gets the entities found in the selected item's body. * @@ -15311,6 +14548,40 @@ declare namespace Office { * **{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}**: Message Read */ getSelectedRegExMatches(): any; + /** + * Gets the properties of an appointment or message in a shared folder, calendar, or mailbox. + * + * [Api set: Mailbox 1.8] + * + * @remarks + * + * **{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}**: ReadItem + * + * **{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}**: Message Read + * + * @param options - An object literal that contains one or more of the following properties. + * asyncContext: Developers can provide any object they wish to access in the callback method. + * @param callback - When the method completes, the function passed in the callback parameter is called with a single parameter of + * type Office.AsyncResult. + * The `value` property of the result is the properties of the shared item. + */ + getSharedPropertiesAsync(options: Office.AsyncContextOptions, callback: (asyncResult: Office.AsyncResult) => void): void; + /** + * Gets the properties of an appointment or message in a shared folder, calendar, or mailbox. + * + * [Api set: Mailbox 1.8] + * + * @remarks + * + * **{@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}**: ReadItem + * + * **{@link https://docs.microsoft.com/outlook/add-ins/#extension-points | Applicable Outlook mode}**: Message Read + * + * @param callback - When the method completes, the function passed in the callback parameter is called with a single parameter of + * type Office.AsyncResult. + * The `value` property of the result is the properties of the shared item. + */ + getSharedPropertiesAsync(callback: (asyncResult: Office.AsyncResult) => void): void; /** * Asynchronously loads custom properties for this add-in on the selected item. *