// Type definitions for Office.js 1.0 // Project: https://github.com/OfficeDev/office-js // Definitions by: OfficeDev , // Ricky Kirkham , // Alex Jerabek , // Elizabeth Samuel , // Alison McKay , // Sam Ramon // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.4 /* office-js Copyright (c) Microsoft Corporation */ //////////////////////////////////////////////////////////////// //////////////////// Begin Office namespace //////////////////// //////////////////////////////////////////////////////////////// declare namespace Office { /** A Promise object. Promises can be chained via ".then", and errors can be caught via ".catch". * When a browser-provided native Promise implementation is available, Office.Promise will switch to use the native Promise instead. */ var Promise: IPromiseConstructor; // **Note**: this is a copy of the PromiseConstructor object from // https://github.com/Microsoft/TypeScript/blob/master/lib/lib.es2015.promise.d.ts // It is necessary so that even with targeting "ES5" and not specifying any libs, // developers will still get IntelliSense for "Office.Promise" just as they would with a regular Promise. // (because even though Promise is part of standard lib.d.ts, PromiseConstructor is not) interface IPromiseConstructor { /** * A reference to the prototype. */ readonly prototype: Promise; /** * Creates a new Promise. * @param executor A callback used to initialize the promise. This callback is passed two arguments: * a resolve callback used resolve the promise with a value or the result of another promise, * and a reject callback used to reject the promise with a provided reason or error. */ new (executor: (resolve: (value?: T | PromiseLike) => void, reject: (reason?: any) => void) => void): Promise; /** * Creates a Promise that is resolved with an array of results when all of the provided Promises * resolve, or rejected when any Promise is rejected. * @param values An array of Promises. * @returns A new Promise. */ all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike, T9 | PromiseLike, T10 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]>; /** * Creates a Promise that is resolved with an array of results when all of the provided Promises * resolve, or rejected when any Promise is rejected. * @param values An array of Promises. * @returns A new Promise. */ all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike, T9 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8, T9]>; /** * Creates a Promise that is resolved with an array of results when all of the provided Promises * resolve, or rejected when any Promise is rejected. * @param values An array of Promises. * @returns A new Promise. */ all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8]>; /** * Creates a Promise that is resolved with an array of results when all of the provided Promises * resolve, or rejected when any Promise is rejected. * @param values An array of Promises. * @returns A new Promise. */ all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7]>; /** * Creates a Promise that is resolved with an array of results when all of the provided Promises * resolve, or rejected when any Promise is rejected. * @param values An array of Promises. * @returns A new Promise. */ all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6]>; /** * Creates a Promise that is resolved with an array of results when all of the provided Promises * resolve, or rejected when any Promise is rejected. * @param values An array of Promises. * @returns A new Promise. */ all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike]): Promise<[T1, T2, T3, T4, T5]>; /** * Creates a Promise that is resolved with an array of results when all of the provided Promises * resolve, or rejected when any Promise is rejected. * @param values An array of Promises. * @returns A new Promise. */ all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike]): Promise<[T1, T2, T3, T4]>; /** * Creates a Promise that is resolved with an array of results when all of the provided Promises * resolve, or rejected when any Promise is rejected. * @param values An array of Promises. * @returns A new Promise. */ all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike]): Promise<[T1, T2, T3]>; /** * Creates a Promise that is resolved with an array of results when all of the provided Promises * resolve, or rejected when any Promise is rejected. * @param values An array of Promises. * @returns A new Promise. */ all(values: [T1 | PromiseLike, T2 | PromiseLike]): Promise<[T1, T2]>; /** * Creates a Promise that is resolved with an array of results when all of the provided Promises * resolve, or rejected when any Promise is rejected. * @param values An array of Promises. * @returns A new Promise. */ all(values: (T | PromiseLike)[]): Promise; /** * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved * or rejected. * @param values An array of Promises. * @returns A new Promise. */ race(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike, T9 | PromiseLike, T10 | PromiseLike]): Promise; /** * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved * or rejected. * @param values An array of Promises. * @returns A new Promise. */ race(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike, T9 | PromiseLike]): Promise; /** * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved * or rejected. * @param values An array of Promises. * @returns A new Promise. */ race(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike]): Promise; /** * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved * or rejected. * @param values An array of Promises. * @returns A new Promise. */ race(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike]): Promise; /** * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved * or rejected. * @param values An array of Promises. * @returns A new Promise. */ race(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike]): Promise; /** * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved * or rejected. * @param values An array of Promises. * @returns A new Promise. */ race(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike]): Promise; /** * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved * or rejected. * @param values An array of Promises. * @returns A new Promise. */ race(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike]): Promise; /** * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved * or rejected. * @param values An array of Promises. * @returns A new Promise. */ race(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike]): Promise; /** * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved * or rejected. * @param values An array of Promises. * @returns A new Promise. */ race(values: [T1 | PromiseLike, T2 | PromiseLike]): Promise; /** * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved * or rejected. * @param values An array of Promises. * @returns A new Promise. */ race(values: (T | PromiseLike)[]): Promise; /** * Creates a new rejected promise for the provided reason. * @param reason The reason the promise was rejected. * @returns A new rejected Promise. */ reject(reason: any): Promise; /** * Creates a new rejected promise for the provided reason. * @param reason The reason the promise was rejected. * @returns A new rejected Promise. */ reject(reason: any): Promise; /** * Creates a new resolved promise for the provided value. * @param value A promise. * @returns A promise whose internal state matches the provided promise. */ resolve(value: T | PromiseLike): Promise; /** * Creates a new resolved promise. * @returns A resolved promise. */ resolve(): Promise; } /** * Gets the Context object that represents the runtime environment of the add-in and provides access to the top-level objects of the API. * * @remarks * * **Support details** * * For more information about Office application and server requirements, see * {@link https://learn.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported applications, by platform* * * * * * * * *
Office on Windows Office in web browser Office on iPad Outlook on mobile devices Office on Mac
Excel Supported Supported Supported Supported
Outlook Supported Supported Supported Supported
PowerPoint Supported Supported Supported Supported
Project Supported Supported
Word Supported Supported Supported Supported
*/ var context: Context; /** * Occurs when the runtime environment is loaded and the add-in is ready to start interacting with the application and hosted document. * * The reason parameter of the initialize event listener function returns an `InitializationReason` enumeration value that specifies how * initialization occurred. A task pane or content add-in can be initialized in two ways: * * - The user just inserted it from Recently Used Add-ins section of the Add-in drop-down list on the Insert tab of the ribbon in the Office * application, or from Insert add-in dialog box. * * - The user opened a document that already contains the add-in. * * *Note*: The reason parameter of the initialize event listener function only returns an `InitializationReason` enumeration value for task pane * and content add-ins. It does not return a value for Outlook add-ins. * * @remarks * * **Support details** * * For more information about Office application and server requirements, see * {@link https://learn.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported applications, by platform* * * * * * * * *
Office on Windows Office in web browser Office on iPad Outlook on mobile devices Office on Mac
Excel Supported Supported Supported Supported
Outlook Supported Supported Supported Supported
PowerPoint Supported Supported Supported Supported
Project Supported Supported
Word Supported Supported Supported Supported
* * @param reason Indicates how the app was initialized. */ function initialize(reason: InitializationReason): void; /** * Ensures that the Office JavaScript APIs are ready to be called by the add-in. If the framework hasn't initialized yet, the callback or promise * will wait until the Office application is ready to accept API calls. Note that though this API is intended to be used inside an Office add-in, it can * also be used outside the add-in. In that case, once Office.js determines that it is running outside of an Office application, it will call * the callback and resolve the promise with "null" for both the application and platform. * * @param callback - An optional callback function, that will receive the application and platform info. * Alternatively, rather than use a callback, an add-in may simply wait for the Promise returned by the function to resolve. * @returns A Promise that contains the application and platform info, once initialization is completed. */ function onReady(callback?: (info: { host: HostType, platform: PlatformType }) => any): Promise<{ host: HostType, platform: PlatformType }>; /** * Toggles on and off the `Office` alias for the full `Microsoft.Office.WebExtension` namespace. * * @remarks * * **Support details** * * For more information about Office application and server requirements, see * {@link https://learn.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported applications, by platform* * * * * * * * *
Office on Windows Office in web browser Office on iPad Outlook on mobile devices Office on Mac
Excel Supported Supported Supported
Outlook Supported Supported Supported Supported
PowerPoint Supported Supported Supported
Project Supported
Word Supported Supported Supported
* * @param useShortNamespace True to use the shortcut alias; otherwise false to disable it. The default is true. */ function useShortNamespace(useShortNamespace: boolean): void; /** * Provides a method for associating action names with functions that carry out an action. */ const actions: Actions; /** * Represents the add-in. */ const addin: Addin; /** * Represents the Auth interface. */ const auth: Auth; /** * Represents the ribbon associated with the Office application. */ const ribbon: Ribbon; /** * Checks if the specified requirement set is supported by the Office application. * @param name - Set name; e.g., "MatrixBindings". * @param minVersion - The minimum required version; e.g., "1.4". */ function isSetSupported(name: string, minVersion?: string): boolean; // Enumerations /** * Provides options to determine the startup behavior of the add-in upon next start-up. */ enum StartupBehavior { /** * The add-in does not load until opened by the user. */ none = 'None', /** * Load the add-in but do not show UI. */ load = 'Load', } /** * Visibility mode of the add-in. */ enum VisibilityMode { /** * UI is Hidden */ hidden = 'Hidden', /** * Displayed as taskpane */ taskpane = 'Taskpane', } /** * Specifies the result of an asynchronous call. * * @remarks * * Returned by the `status` property of the {@link Office.AsyncResult | AsyncResult} object. */ enum AsyncResultStatus { /** * The call succeeded. */ Succeeded, /** * The call failed, check the error object. */ Failed } /** * Specifies whether the add-in was just inserted or was already contained in the document. */ enum InitializationReason { /** * The add-in was just inserted into the document. */ Inserted, /** * The add-in is already part of the document that was opened. */ DocumentOpened } /** * Specifies the Office application in which the add-in is running. * * @remarks * **Important**: In Outlook, this enum is available from Mailbox requirement set 1.5. */ enum HostType { /** * The Office application is Microsoft Word. */ Word, /** * The Office application is Microsoft Excel. */ Excel, /** * The Office application is Microsoft PowerPoint. */ PowerPoint, /** * The Office application is Microsoft Outlook. */ Outlook, /** * The Office application is Microsoft OneNote. */ OneNote, /** * The Office application is Microsoft Project. */ Project, /** * The Office application is Microsoft Access. * * **Important**: We no longer recommend that you create and use Access web apps and databases in SharePoint. * As an alternative, we recommend that you use {@link https://powerapps.microsoft.com/ | Microsoft PowerApps} * to build no-code business solutions for web and mobile devices. */ Access } /** * Specifies the OS or other platform on which the Office application is running. * * @remarks * **Important**: In Outlook, this enum is available from Mailbox requirement set 1.5. */ enum PlatformType { /** * The platform is PC (Windows). */ PC, /** * The platform is Office on the web (in a browser). */ OfficeOnline, /** * The platform is Mac. */ Mac, /** * The platform is an iOS device. */ iOS, /** * The platform is an Android device. */ Android, /** * The platform is WinRT. */ Universal } // Objects /** * An object which encapsulates the result of an asynchronous request, including status and error information if the request failed. * * When the function you pass to the `callback` parameter of an "Async" method executes, it receives an AsyncResult object that you can access * from the `callback` function's only parameter. */ interface AsyncResult { /** * Gets the user-defined item passed to the optional `asyncContext` parameter of the invoked method in the same state as it was passed in. * This returns the user-defined item (which can be of any JavaScript type: String, Number, Boolean, Object, Array, Null, or Undefined) passed * to the optional `asyncContext` parameter of the invoked method. Returns Undefined, if you didn't pass anything to the asyncContext parameter. */ asyncContext: any; /** * Gets an object that may provide additional information if an {@link Office.Error | error} occurred. * * @remarks * * This property returns additional information if the following errors occur with these supported APIs. * * *Supported APIs* * * `Office.context.mailbox.item.getCallbackTokenAsync`, `Office.context.mailbox.item.getUserIdentityTokenAsync` * * *Supported errors* * * * * *
AsyncResult.error.name AsyncResult.error.message Description of diagnostics object returned
HTTPRequestFailure The request has failed. Please look at the diagnostics object for the HTTP error code. The HTTP error code in a JSON object e.g., {"HTTPCode":"401"}
InternalServerErrorThe Exchange server returned an error. Please look at the diagnostics object for more information.The error message from the Exchange server in a JSON object e.g., {"ErrorText": "The mailbox database is temporarily unavailable"}
*/ diagnostics: any; /** * Gets an {@link Office.Error} object that provides a description of the error, if any error occurred. */ error: Office.Error; /** * Gets the {@link Office.AsyncResultStatus} of the asynchronous operation. */ status: AsyncResultStatus; /** * Gets the payload or content of this asynchronous operation, if any. * * @remarks * * You access the AsyncResult object in the function passed as the argument to the callback parameter of an "Async" method, such as the * `getSelectedDataAsync` and `setSelectedDataAsync` methods of the {@link Office.Document | Document} object. * * **Note**: What the value property returns for a particular "Async" method varies depending on the purpose and context of that method. * To determine what is returned by the value property for an "Async" method, refer to the "Callback value" section of the method's topic. */ value: T; } /** * Manages actions and keyboard shortcuts. */ interface Actions { /** * Associates the ID or name of an action with a function. * * @param actionId The ID of an action that is defined in an extended manifest or the name of the function as specified in a **FunctionName** element in the manifest. * @param actionFunction The function that is run when the action is invoked. */ associate: (actionId: string, actionFunction: (arg?: any) => void) => void; /** * Replaces existing add-in shortcuts with custom shortcuts for the user. * * @remarks * * **Requirement sets**: * * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/keyboard-shortcuts-requirement-sets | KeyboardShortcuts 1.1} * * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/shared-runtime-requirement-sets | SharedRuntime 1.1} * * @param shortcuts An object of custom shortcuts with keys being the IDs of the actions (as defined in an extended manifest) and values being the shortcut combinations. For example, `{"SetItalic": "Ctrl+1", "SetBold": "Ctrl+2"}`. * To learn how to specify a valid action ID and a key combination, see {@link https://learn.microsoft.com/office/dev/add-ins/design/keyboard-shortcuts | Add custom keyboard shortcuts to your Office Add-ins}. (Note that a key combination can be `null`, in which case, the action keeps the key combination specified in the JSON file.) * @returns A promise that resolves when every custom shortcut assignment in `shortcuts` has been registered. Even if there is a conflict with existing shortcuts, the customized shortcut will be registered. * Otherwise, the promise will be rejected with error code and error message. An "InvalidOperation" error code is returned if any action ID in `shortcuts` does not exist, or if shortcut combination is invalid. */ replaceShortcuts(shortcuts: {[actionId: string]: string}): Promise; /** * Gets the existing shortcuts for the add-in. The set always includes (1) the shortcuts defined in the add-in's extended manifest for keyboard shortcuts and (2) the current user's custom shortcuts if those exist. * The shortcut can be `null` if it conflicts with the shortcut of another add-in or with the Office application. Specifically, it would be `null` if, when prompted to choose which shortcut to use, the user didn't choose the action of the current add-in. For more information about conflicts with shortcuts, see {@link https://learn.microsoft.com/office/dev/add-ins/design/keyboard-shortcuts#avoid-key-combinations-in-use-by-other-add-ins | Avoid key combinations in use by other add-ins}. * * @remarks * * **Requirement sets**: * * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/keyboard-shortcuts-requirement-sets | KeyboardShortcuts 1.1} * * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/shared-runtime-requirement-sets | SharedRuntime 1.1} * * @returns A promise that resolves to an object of shortcuts, with keys being the IDs of the actions (as defined in an extended manifest) and values being the shortcut combinations. For example, `{"SetItalic": "Ctrl+1", "SetBold": "Ctrl+2", "SetUnderline": null}`. */ getShortcuts(): Promise<{[actionId: string]: string|null}>; /** * Checks if a set of shortcut combinations are currently in use for the user, as defined by another add-in or by the Office application. * * @remarks * * **Requirement sets**: * * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/keyboard-shortcuts-requirement-sets | KeyboardShortcuts 1.1} * * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/shared-runtime-requirement-sets | SharedRuntime 1.1} * * @param shortcuts An array of shortcut combinations. For example, `["Ctrl+1", "Ctrl+2"]`. * @returns A promise that resolves to an array of objects. Each object consists of a shortcut combination and Boolean value. The value is `true` if the shortcut combination conflicts with a shortcut of another add-in or with a shortcut of the Office application; otherwise, `false`. For example, `[{shortcut:"Ctrl+1", inUse:true},{shortcut:"Ctrl+2", inUse:false}]`. */ areShortcutsInUse(shortcuts: string[]): Promise<{shortcut: string, inUse: boolean}[]>; } /** * Message used in the `onVisibilityModeChanged` invocation. */ interface VisibilityModeChangedMessage { /** * Visibility changed state. */ visibilityMode: Office.VisibilityMode; } /** * Represents add-in level functionality for operating or configuring various aspects of the add-in. * * @remarks * * **Requirement set**: {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/shared-runtime-requirement-sets | SharedRuntime 1.1} */ interface Addin { /** * Sets the startup behavior for the add-in for when the document is opened next time. * @param behavior - Specifies startup behavior of the add-in. * * @remarks * **Requirement set**: {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/shared-runtime-requirement-sets | SharedRuntime 1.1} */ setStartupBehavior(behavior: Office.StartupBehavior): Promise; /** * Gets the current startup behavior for the add-in. * * @remarks * **Requirement set**: {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/shared-runtime-requirement-sets | SharedRuntime 1.1} */ getStartupBehavior(): Promise; /** * Shows the task pane associated with the add-in. * @returns A promise that is resolved when the UI is shown. * * @remarks * **Requirement set**: {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/shared-runtime-requirement-sets | SharedRuntime 1.1} */ showAsTaskpane(): Promise; /** * Hides the task pane. * @returns A promise that is resolved when the UI is hidden. * * @remarks * **Requirement set**: {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/shared-runtime-requirement-sets | SharedRuntime 1.1} */ hide(): Promise; /** * Adds a handler for the `onVisibilityModeChanged` event. * @param handler - The handler function that is called when the event is emitted. This function takes in a message for the receiving component. * @returns A promise that resolves to a function when the handler is added. Calling it removes the handler. * * @remarks * **Requirement set**: {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/shared-runtime-requirement-sets | SharedRuntime 1.1} */ onVisibilityModeChanged( handler: (message: VisibilityModeChangedMessage) => void, ): Promise<() => Promise>; /** * Represents a modal notification dialog that can appear when the user attempts to close a document. The document won't close until the user responds. * This API is only supported in Excel. * * @remarks * **Requirement set**: {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/shared-runtime-requirement-sets | SharedRuntime 1.2} */ beforeDocumentCloseNotification: BeforeDocumentCloseNotification; } /** * Represents a modal notification dialog that can appear when the user attempts to close a document. The document won't close until the user responds. * The notification dialog will allow the user to confirm the request to close the document or cancel the request to close the document. * This API is only supported in Excel. * * @remarks * **Requirement set**: {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/shared-runtime-requirement-sets | SharedRuntime 1.2} */ interface BeforeDocumentCloseNotification { /** * Enable a modal notification dialog that appears when the user attempts to close a document. The document won't close until the user responds. * This notification dialog asks the user to confirm the request to close the document, or allows the user to cancel the request to close the document. * The `BeforeDocumentCloseNotification` API is only supported in Excel. * * @remarks * **Requirement set**: {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/shared-runtime-requirement-sets | SharedRuntime 1.2} */ enable(): Promise; /** * Prevents the notification dialog from appearing when the user attempts to close a document. * The `BeforeDocumentCloseNotification` API is only supported in Excel. * * @remarks * **Requirement set**: {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/shared-runtime-requirement-sets | SharedRuntime 1.2} */ disable(): Promise; /** * Adds an event handler that detects when the `BeforeDocumentCloseNotification` close operation is cancelled. * This event handler will be triggered if both of the following conditions are met. * * 1. The add-in calls the `enable` method on the `BeforeDocumentCloseNotification` object. * * 2. When the notification dialog is open, the end user clicks the **Don't close** button within the dialog, clicks the Close button in the upper right corner of the dialog, or presses the Esc key. * * The `BeforeDocumentCloseNotification` API is only supported in Excel. * @param handler The event handler that is called when the dialog is cancelled. * @returns A promise that resolves when the event handler is added. * * @remarks * **Requirement set**: {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/shared-runtime-requirement-sets | SharedRuntime 1.2} */ onCloseActionCancelled( handler: () => void ): Promise<() => Promise>; } /** * An interface that contains all the functionality provided to manage the state of the Office ribbon. * * @remarks * * **Requirement set**: {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/ribbon-api-requirement-sets | RibbonApi 1.1} */ interface Ribbon { /** * Registers a custom contextual tab with Office and defines the tab's controls. * * @remarks * * **Requirement set**: {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/ribbon-api-requirement-sets | RibbonApi 1.2} * * This method only requests that the tab be registered. The actual registration is controlled by the Office application and may not be complete when the returned `Promise` object is resolved. * For more information and code examples, see {@link https://learn.microsoft.com/office/dev/add-ins/design/contextual-tabs | Create custom contextual tabs}. * * @param tabDefinition - Specifies the tab's properties and child controls and their properties. This parameter isn't strongly typed because its shape is defined by a JSON schema that can be versioned. To create the parameter object, pass a JSON string that conforms to the Office {@link https://developer.microsoft.com/json-schemas/office-js/dynamic-ribbon.schema.json | dynamic-ribbon JSON schema} to `JSON.parse`, and then pass the returned object to this method. To get IntelliSense for the JSON in Visual Studio Code, see {@link https://code.visualstudio.com/docs/languages/json#_json-schemas-and-settings | Editing JSON with Visual Studio Code - JSON schemas and settings }. */ requestCreateControls(tabDefinition: Object): Promise; /** * Sends a request to Office to update the ribbon. * * @remarks * * **Requirement set**: {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/ribbon-api-requirement-sets | RibbonApi 1.1} * * Note that this API is only to request an update. The actual UI update to the ribbon is controlled by the Office application and hence the exact timing of the ribbon update (or refresh) cannot be determined by the completion of this API. * * For code examples, see {@link https://learn.microsoft.com/office/dev/add-ins/design/disable-add-in-commands | Enable and Disable Add-in Commands} and {@link https://learn.microsoft.com/office/dev/add-ins/design/contextual-tabs | Create custom contextual tabs}. * * @param input - Represents the updates to be made to the ribbon. Note that only the changes specified in the input parameter are made. */ requestUpdate(input: RibbonUpdaterData): Promise; } /** * Specifies changes to the ribbon, such as the enabled or disabled status of a button. * * @remarks * * **Requirement set**: {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/ribbon-api-requirement-sets | RibbonApi 1.1} */ interface RibbonUpdaterData { /** * Collection of tabs whose state is set with the call of `requestUpdate`. */ tabs: Tab[]; } /** * Represents an individual tab and the state it should have. For code examples, see {@link https://learn.microsoft.com/office/dev/add-ins/design/disable-add-in-commands | Enable and Disable Add-in Commands} and {@link https://learn.microsoft.com/office/dev/add-ins/design/contextual-tabs | Create custom contextual tabs}. * * @remarks * * **Requirement set**: {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/ribbon-api-requirement-sets | RibbonApi 1.1} */ interface Tab { /** * Identifier of the tab as specified in the manifest. */ id: string; /** * Specifies one or more of the controls in the tab, such as menu items, buttons, etc. * * @remarks * * When the `Tab` object is part of an {@link Office.RibbonUpdaterData} object passed to the `requestUpdate` method of {@link Office.Ribbon}, this property specifies the IDs of the controls whose enabled status is to be changed. However, if there is a `groups` property on the tab, then this property is ignored and the `controls` properties of the specified groups must be used to change enabled status. */ controls?: Control[]; /** * Specifies whether the tab is visible on the ribbon. Used only with contextual tabs. * * @remarks * * **Requirement set**: {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/ribbon-api-requirement-sets | RibbonApi 1.2} */ visible?: boolean; /** * Specifies one or more of the control groups on the tab. * * @remarks * * When the `Tab` object is part of an {@link Office.RibbonUpdaterData} object passed to the `requestUpdate` method of {@link Office.Ribbon}, the `controls` properties of the various {@link Office.Group} objects specify which controls have their enabled status changed; the `controls` property of the `Tab` object is ignored. * * **Requirement set**: {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/ribbon-api-requirement-sets | RibbonApi 1.1} */ groups?: Group[]; } /** * Represents a group of controls on a ribbon tab. * * **Requirement set**: {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/ribbon-api-requirement-sets | RibbonApi 1.1} */ interface Group { /** * Identifier of the group as specified in the manifest. * */ id: string; /** * Specifies one or more of the controls in the group, such as menu items, buttons, etc. * * @remarks * * When the `Group` object is part of an {@link Office.RibbonUpdaterData} object passed to the `requestUpdate` method of {@link Office.Ribbon}, the `controls` properties of the various {@link Office.Group} objects specify which controls have their enabled status changed; the `controls` property of the `Group` object's parent `Tab` object is ignored. */ controls?: Control[]; } /** * Represents an individual control or command and the state it should have. * * @remarks * * For code samples showing how to use a `Control` object and its properties, see {@link https://learn.microsoft.com/office/dev/add-ins/design/disable-add-in-commands | Enable and Disable Add-in Commands} and {@link https://learn.microsoft.com/office/dev/add-ins/design/contextual-tabs | Create custom contextual tabs}. * * **Requirement set**: {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/ribbon-api-requirement-sets | RibbonApi 1.1} */ interface Control { /** * Identifier of the control as specified in the manifest. */ id: string; /** * Indicates whether the control should be enabled or disabled. The default is true. */ enabled?: boolean; } /** * Represents the runtime environment of the add-in and provides access to key objects of the API. * The current context exists as a property of Office. It is accessed using `Office.context`. * * @remarks * * **Applications**: Excel, Outlook, PowerPoint, Project, Word */ interface Context { /** * Provides information and access to the signed-in user. * * @beta */ auth: Auth; /** * True, if the current platform allows the add-in to display a UI for selling or upgrading; otherwise returns False. * * @remarks * * **Applications**: Excel, Word * * `commerceAllowed` is only supported in Office on iPad. * * The iOS App Store doesn't support apps with add-ins that provide links to additional payment systems. However, Office Add-ins running in * Office on the Windows desktop or in the browser do allow such links. If you want the UI of your add-in to provide a link to an * external payment system on platforms other than iOS, you can use the commerceAllowed property to control when that link is displayed. */ commerceAllowed: boolean; /** * Gets the locale (language) specified by the user for editing the document or item. * * @remarks * * The `contentLanguage` value reflects the **Editing Language** setting specified with **File** \> **Options** \> **Language** in the Office * application. * * **Support details** * * For more information about Office application and server requirements, see * {@link https://learn.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported applications, by platform* * * * * * * * *
Office on Windows Office in web browser Office on iPad Outlook on mobile devices Office on Mac
Excel Supported Supported Supported
Outlook Supported Supported Supported Supported
PowerPoint Supported Supported Supported
Project Supported
Word Supported Supported Supported
*/ contentLanguage: string; /** * Gets information about the environment in which the add-in is running. * * @remarks * **Important**: In Outlook, this property is available from Mailbox requirement set 1.5. * For all Mailbox requirement sets, you can use the * {@link https://learn.microsoft.com/javascript/api/outlook/office.mailbox?view=outlook-js-preview&preserve-view=true#outlook-office-mailbox-diagnostics-member | Office.context.mailbox.diagnostics} * property to get similar information. */ diagnostics: ContextInformation; /** * Gets the locale (language) specified by the user for the UI of the Office application. * * @remarks * * The returned value is a string in the RFC 1766 Language tag format, such as en-US. * * The `displayLanguage` value reflects the current **Display Language** setting specified with **File** \> **Options** \> **Language** in the Office * application. * * When using in Outlook, the applicable modes are Compose or Read. * * **Support details** * * For more information about Office application and server requirements, see * {@link https://learn.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported applications, by platform* * * * * * * * *
Office on Windows Office in web browser Office on iPad Outlook on mobile devices Office on Mac
Excel Supported Supported Supported Supported
Outlook Supported Supported Supported Supported
PowerPoint Supported Supported Supported Supported
Project Supported Supported
Word Supported Supported Supported
*/ displayLanguage: string; /** * Gets an object that represents the document the content or task pane add-in is interacting with. */ document: Office.Document; /** * Contains the Office application in which the add-in is running. * * @remarks * **Important**: In Outlook, this property is available from Mailbox requirement set 1.5. You can also use the * `Office.context.diagnostics` property to get the application starting with requirement set 1.5. For all * Mailbox requirement sets, you can use the * {@link https://learn.microsoft.com/javascript/api/outlook/office.mailbox?view=outlook-js-preview&preserve-view=true#outlook-office-mailbox-diagnostics-member | Office.context.mailbox.diagnostics} * property to get similar information. */ host: HostType; /** * Gets the license information for the user's Office installation. */ license: string; /** * Provides access to the Microsoft Outlook add-in object model. * * @remarks * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **restricted** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose or Read * * **Key properties**: * * - `diagnostics`: Provides diagnostic information to an Outlook add-in. * * - `item`: Provides methods and properties for accessing a message or appointment in an Outlook add-in. * * - `userProfile`: Provides information about the user in an Outlook add-in. */ mailbox: Office.Mailbox; /** * Provides access to the properties for Office theme colors. */ officeTheme: OfficeTheme; /** * Provides the platform on which the add-in is running. * * @remarks * **Important**: In Outlook, this property is available from Mailbox requirement set 1.5. You can also use the * `Office.context.diagnostics` property to get the platform starting with requirement set 1.5. For all * Mailbox requirement sets, you can use the * {@link https://learn.microsoft.com/javascript/api/outlook/office.mailbox?view=outlook-js-preview&preserve-view=true#outlook-office-mailbox-diagnostics-member | Office.context.mailbox.diagnostics} * property to get similar information. */ platform: PlatformType; /** * Provides a method for determining what requirement sets are supported on the current Office application and platform. */ requirements: RequirementSetSupport; /** * Gets an object that represents the custom settings or state of a mail add-in saved to a user's mailbox. * * The `RoamingSettings` object lets you store and access data for a mail add-in that is stored in a user's mailbox, so it's available to * that add-in when it is running from any client application used to access that mailbox. * * @remarks * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **restricted** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose or Read */ roamingSettings: Office.RoamingSettings; /** * Gets the object to check the status of the catalog of sensitivity labels in Outlook and retrieve all available * sensitivity labels if the catalog is enabled. * * @remarks * * [Api set: Mailbox 1.13] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read/write item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose */ sensitivityLabelsCatalog: Office.SensitivityLabelsCatalog; /** * Specifies whether the platform and device allows touch interaction. * True if the add-in is running on a touch device, such as an iPad; false otherwise. * * @remarks * * **Applications**: Excel, PowerPoint, Word * * `touchEnabled` is only supported in Office on iPad. * * Use the touchEnabled property to determine when your add-in is running on a touch device and if necessary, adjust the kind of controls, and * size and spacing of elements in your add-in's UI to accommodate touch interactions. */ touchEnabled: boolean; /** * Provides objects and methods that you can use to create and manipulate UI components, such as dialog boxes. */ ui: UI; } /** * Provides specific information about an error that occurred during an asynchronous data operation. * * @remarks * * The Error object is accessed from the AsyncResult object that is returned in the function passed as the callback argument of an asynchronous * data operation, such as the `setSelectedDataAsync` method of the Document object. */ interface Error { /** * Gets the numeric code of the error. For a list of error codes, see {@link https://learn.microsoft.com/office/dev/add-ins/reference/javascript-api-for-office-error-codes | JavaScript API for Office error codes}. */ code: number; /** * Gets a detailed description of the error. */ message: string; /** * Gets the name of the error. */ name: string; } namespace AddinCommands { /** * The `Event` object is passed as a parameter to add-in functions invoked by function command buttons. The object allows the add-in to identify * which button was clicked and to signal the Office application that it has completed its processing. * * @remarks * * For information on support in Excel, Word, and PowerPoint, see * {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/add-in-commands-requirement-sets | Add-in commands requirement sets}. * * The following outlines support information for Outlook. * * [Api set: Mailbox 1.3] * * See {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/add-in-commands-requirement-sets | Add-in commands requirement sets} for more support information. * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level (Outlook)}**: **restricted** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose or Read */ interface Event { /** * Information about the control that triggered calling this function. * * @remarks * * The following outlines support information for Outlook. * * [Api set: Mailbox 1.3] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **restricted** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose or Read */ source:Source; /** * Indicates that the add-in has completed processing and will automatically be closed. * * This method must be called at the end of a function which was invoked by the following: * * - A function command button (that is, an add-in command defined with an **\** element, where the `xsi:type` attribute is set to `ExecuteFunction`). * * - An {@link https://learn.microsoft.com/javascript/api/manifest/event | event} defined in the * {@link https://learn.microsoft.com/javascript/api/manifest/extensionpoint#events | Events extension point} of an on-send add-in in Outlook. * For example, an `ItemSend` event. * * @remarks * * The following outlines support information for Outlook. * * [Api set: Mailbox 1.3] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **restricted** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose or Read * * **Important**: The `options` parameter only applies to Outlook add-ins that implement the * {@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-on-send-addins | on-send feature}. It was introduced in Mailbox 1.8. * * @param options Optional. An object that specifies the behavior of an on-send add-in in Outlook when it completes processing an `ItemSend` event. */ completed(options?: EventCompletedOptions): void; } /** * Specifies the behavior of an {@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-on-send-addins | on-send} add-in in Outlook * when it completes processing an `ItemSend` event. * * @remarks * * [Api set: Mailbox 1.8] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **restricted** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose */ interface EventCompletedOptions { /** * When you use the {@link https://learn.microsoft.com/javascript/api/office/office.addincommands.event#office-office-addincommands-event-completed-member(1) | completed method} * to signal completion of an event handler, this value indicates if the handled event should continue execution or be canceled. * For example, an on-send add-in that handles the `ItemSend` event can set `allowEvent` to `false` to cancel the sending of a message. * * @remarks * * [Api set: Mailbox 1.8] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level (Outlook)}**: **restricted** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose */ allowEvent?: boolean; } /** * Encapsulates source data for add-in events. * * @remarks * * For information on support in Excel, Word, and PowerPoint, see * {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/add-in-commands-requirement-sets | Add-in commands requirement sets}. * * The following outlines support information for Outlook. * * [Api set: Mailbox 1.3] * * See {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/add-in-commands-requirement-sets | Add-in commands requirement sets} for more support information. * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level (Outlook)}**: **restricted** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose or Read */ interface Source { /** * The ID of the control that triggered calling this function. The ID comes from the manifest. * * @remarks * * The following outlines support information for Outlook. * * [Api set: Mailbox 1.3] * * See {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/add-in-commands-requirement-sets | Add-in commands requirement sets} for more support information. * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level (Outlook)}**: **restricted** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose or Read */ id: string; } } /** * Provides objects and methods that you can use to create and manipulate UI components, such as dialog boxes, in your Office Add-ins. * * Visit "{@link https://learn.microsoft.com/office/dev/add-ins/develop/dialog-api-in-office-add-ins | Use the Dialog API in your Office Add-ins}" * for more information. */ interface UI { /** * Adds an event handler to the object using the specified event type. * * @remarks * * **Requirement set**: {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/dialog-api-requirement-sets | DialogApi 1.2} * * You can add multiple event handlers for the specified event type as long as the name of each event handler function is unique. * * @param eventType Specifies the type of event to add. This must be `Office.EventType.DialogParentMessageReceived`. * @param handler The event handler function to add, whose only parameter is of type {@link Office.DialogParentMessageReceivedEventArgs}. * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. * @param callback Optional. A function that is invoked when the handler registration returns, whose only parameter is of type {@link Office.AsyncResult}. */ addHandlerAsync(eventType: Office.EventType, handler: (result: DialogParentMessageReceivedEventArgs) => void, options: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Adds an event handler to the object using the specified event type. * * @remarks * * **Requirement set**: {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/dialog-api-requirement-sets | DialogApi 1.2} * * You can add multiple event handlers for the specified event type as long as the name of each event handler function is unique. * * @param eventType Specifies the type of event to add. This must be `Office.EventType.DialogParentMessageReceived`. * @param handler The event handler function to add, whose only parameter is of type {@link Office.DialogParentMessageReceivedEventArgs}. * @param callback Optional. A function that is invoked when the handler registration returns, whose only parameter is of type {@link Office.AsyncResult}. */ addHandlerAsync(eventType: Office.EventType, handler: (result: DialogParentMessageReceivedEventArgs) => void, callback?: (result: AsyncResult) => void): void; /** * Displays a dialog to show or collect information from the user or to facilitate Web navigation. * * @remarks * * **Applications**: Excel, Outlook, PowerPoint, Word * * **Requirement sets**: * * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/dialog-api-requirement-sets | DialogApi} * * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/outlook/outlook-api-requirement-sets | Mailbox 1.4} * * This method is available in the DialogApi requirement set for Excel, PowerPoint, or Word add-ins, and in the Mailbox requirement set 1.4 * for Outlook. For more on how to specify a requirement set in your manifest, see * {@link https://learn.microsoft.com/office/dev/add-ins/develop/specify-office-hosts-and-api-requirements | Specify Office applications and API requirements}, if you're using the XML manifest. If you're using the Teams manifest (preview), see {@link https://learn.microsoft.com/office/dev/add-ins/develop/json-manifest-overview | Teams manifest for Office Add-ins (preview)}. * * The initial page must be on the same domain as the parent page (the startAddress parameter). After the initial page loads, you can go to * other domains. * * Any page calling `Office.context.ui.messageParent` must also be on the same domain as the parent page. * * **Design considerations**: * * The following design considerations apply to dialog boxes. * * - An Office Add-in task pane can have only one dialog box open at any time. Multiple dialogs can be open at the same time from Add-in * Commands (custom ribbon buttons or menu items). * * - Every dialog box can be moved and resized by the user. * * - Every dialog box is centered on the screen when opened. * * - Dialog boxes appear on top of the application and in the order in which they were created. * * Use a dialog box to: * * - Display authentication pages to collect user credentials. * * - Display an error/progress/input screen from a ShowTaskpane or ExecuteAction command. * * - Temporarily increase the surface area that a user has available to complete a task. * * Do not use a dialog box to interact with a document. Use a task pane instead. * * **displayDialogAsync Errors** * * * * * * * * * * * * * * * * * * * * * * *
Code numberMeaning
12004The domain of the URL passed to displayDialogAsync is not trusted. The domain must be either the same domain as the host page (including protocol and port number), or it must be registered in the AppDomains section of the add-in manifest.
12005The URL passed to displayDialogAsync uses the HTTP protocol. HTTPS is required. (In some versions of Office, the error message returned with 12005 is the same one returned for 12004.)
12007A dialog box is already opened from the task pane. A task pane add-in can only have one dialog box open at a time.
12009The user chose to ignore the dialog box. This error can occur in online versions of Office, where users may choose not to allow an add-in to present a dialog.
* * In the callback function passed to the displayDialogAsync method, you can use the properties of the AsyncResult object to return the * following information. * * * * * * * * * * * * * * * * * * * * * * *
PropertyUse
AsyncResult.valueAccess the Dialog object
AsyncResult.statusDetermine the success or failure of the operation
AsyncResult.errorAccess an Error object that provides error information if the operation failed
AsyncResult.asyncContextAccess your user-defined object or value, if you passed one as the asyncContext parameter
* * @param startAddress - Accepts the initial full HTTPS URL that opens in the dialog. Relative URLs must not be used. * @param options - Optional. Accepts an {@link Office.DialogOptions} object to define dialog display. * @param callback - Optional. Accepts a callback function to handle the dialog creation attempt. If successful, the AsyncResult.value is a Dialog object. */ displayDialogAsync(startAddress: string, options?: DialogOptions, callback?: (result: AsyncResult) => void): void; /** * Displays a dialog to show or collect information from the user or to facilitate Web navigation. * * @remarks * * **Applications**: Excel, Outlook, PowerPoint, Word * * **Requirement sets**: * * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/dialog-api-requirement-sets | DialogApi} * * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/outlook/outlook-api-requirement-sets | Mailbox 1.4} * * This method is available in the DialogApi requirement set for Excel, PowerPoint, or Word add-ins, and in the Mailbox requirement set 1.4 * for Outlook. For more on how to specify a requirement set in your manifest, see * {@link https://learn.microsoft.com/office/dev/add-ins/develop/specify-office-hosts-and-api-requirements | Specify Office applications and API requirements}, if you're using the XML manifest. If you're using the Teams manifest (preview), see {@link https://learn.microsoft.com/office/dev/add-ins/develop/json-manifest-overview | Teams manifest for Office Add-ins (preview)}. * * The initial page must be on the same domain as the parent page (the startAddress parameter). After the initial page loads, you can go to * other domains. * * Any page calling `Office.context.ui.messageParent` must also be on the same domain as the parent page. * * **Design considerations**: * * The following design considerations apply to dialog boxes. * * - An Office Add-in task pane can have only one dialog box open at any time. Multiple dialogs can be open at the same time from Add-in * Commands (custom ribbon buttons or menu items). * * - Every dialog box can be moved and resized by the user. * * - Every dialog box is centered on the screen when opened. * * - Dialog boxes appear on top of the application and in the order in which they were created. * * Use a dialog box to: * * - Display authentication pages to collect user credentials. * * - Display an error/progress/input screen from a ShowTaskpane or ExecuteAction command. * * - Temporarily increase the surface area that a user has available to complete a task. * * Do not use a dialog box to interact with a document. Use a task pane instead. * * **displayDialogAsync Errors** * * * * * * * * * * * * * * * * * * * * * * *
Code numberMeaning
12004The domain of the URL passed to displayDialogAsync is not trusted. The domain must be either the same domain as the host page (including protocol and port number), or it must be registered in the AppDomains section of the add-in manifest.
12005The URL passed to displayDialogAsync uses the HTTP protocol. HTTPS is required. (In some versions of Office, the error message returned with 12005 is the same one returned for 12004.)
12007A dialog box is already opened from the task pane. A task pane add-in can only have one dialog box open at a time.
12009The user chose to ignore the dialog box. This error can occur in online versions of Office, where users may choose not to allow an add-in to present a dialog.
* * In the callback function passed to the displayDialogAsync method, you can use the properties of the AsyncResult object to return the * following information. * * * * * * * * * * * * * * * * * * * * * * *
PropertyUse
AsyncResult.valueAccess the Dialog object
AsyncResult.statusDetermine the success or failure of the operation
AsyncResult.errorAccess an Error object that provides error information if the operation failed
AsyncResult.asyncContextAccess your user-defined object or value, if you passed one as the asyncContext parameter
* * @param startAddress - Accepts the initial full HTTPS URL that opens in the dialog. Relative URLs must not be used. * @param callback - Optional. Accepts a callback function to handle the dialog creation attempt. If successful, the AsyncResult.value is a Dialog object. */ displayDialogAsync(startAddress: string, callback?: (result: AsyncResult) => void): void; /** * Delivers a message from the dialog box to its parent/opener page. * * @remarks * * **Requirement sets**: * * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/dialog-api-requirement-sets | DialogApi} * * - If the `messageOptions` parameter is used, {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/dialog-origin-requirement-sets | DialogOrigin 1.1} is also required. * * @param message Accepts a message from the dialog to deliver to the add-in. Anything that can serialized to a string including JSON and XML can be sent. * @param messageOptions Optional. Provides options for how to send the message. */ messageParent(message: string, messageOptions?: DialogMessageOptions): void; /** * Closes the UI container where the JavaScript is executing. * * @remarks * * **Applications**: Excel, Outlook (Minimum requirement set: Mailbox 1.5), PowerPoint, Word * * **Requirement sets**: * * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/dialog-api-requirement-sets | DialogApi} * * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/outlook/outlook-api-requirement-sets | Mailbox 1.5} * * The behavior of this method is specified by the following: * * - Called from a UI-less command button: No effect. Any dialog opened by displayDialogAsync will remain open. * * - Called from a task pane: The task pane will close. Any dialog opened by displayDialogAsync will also close. * If the task pane supports pinning and was pinned by the user, it will be un-pinned. * * - Called from a module extension: No effect. */ closeContainer(): void; /** * Opens a browser window and loads the specified URL. * * @remarks * * **Requirement set**: {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/open-browser-window-api-requirement-sets | OpenBrowserWindowApi 1.1} * * @param url The full URL to be opened including protocol (e.g., https), and port number, if any. */ openBrowserWindow(url: string): void; } /** * Provides information about which Requirement Sets are supported in the current environment. */ interface RequirementSetSupport { /** * Check if the specified requirement set is supported by the Office application. * @param name - The requirement set name (e.g., "ExcelApi"). * @param minVersion - The minimum required version (e.g., "1.4"). */ isSetSupported(name: string, minVersion?: string): boolean; /** * Check if the specified requirement set is supported by the Office application. * * **Warning**: This overload of `isSetSupported` (where `minVersionNumber` is a number) has been deprecated. Use the string overload of `isSetSupported` instead. * * @deprecated Use the string overload of `isSetSupported` instead. * @param name - The requirement set name (e.g., "ExcelApi"). * @param minVersionNumber - The minimum required version (e.g., 1.4). */ isSetSupported(name: string, minVersionNumber?: number): boolean; } /** * Provides options for how a dialog is displayed. */ interface DialogOptions { /** * Defines the height of the dialog as a percentage of the current display. Defaults to 80%. 250px minimum. */ height?: number, /** * Defines the width of the dialog as a percentage of the current display. Defaults to 80%. 150px minimum. */ width?: number, /** * Determines whether the dialog box should be displayed within an IFrame. This setting is only applicable in Office on the web, and is * ignored by other platforms. If false (default), the dialog will be displayed as a new browser window (pop-up). Recommended for * authentication pages that cannot be displayed in an IFrame. If true, the dialog will be displayed as a floating overlay with an IFrame. * This is best for user experience and performance. */ displayInIframe?: boolean /** * Determines if the pop-up blocker dialog will be shown to the user. Defaults to true. * * `true` - The framework displays a pop-up to trigger the navigation and avoid the browser's pop-up blocker. * `false` - The dialog will not be shown and the developer must handle pop-ups (by providing a user interface artifact to trigger the navigation). */ promptBeforeOpen?: boolean; /** * A user-defined item of any type that is returned, unchanged, in the asyncContext property of the AsyncResult object that is passed to a callback. */ asyncContext?: any } /** * The Office Auth namespace, `Office.auth`, provides a method that allows the Office client application to obtain an access token to the add-in's web application. * Indirectly, this also enables the add-in to access the signed-in user's Microsoft Graph data without requiring the user to sign in a second time. */ interface Auth { /** * Calls the Azure Active Directory V 2.0 endpoint to get an access token to your add-in's web application. Enables add-ins to identify users. * Server-side code can use this token to access Microsoft Graph for the add-in's web application by using the * {@link https://learn.microsoft.com/azure/active-directory/develop/active-directory-v2-protocols-oauth-on-behalf-of | "on behalf of" OAuth flow}. * * **Important**: In Outlook, this API isn't supported if the add-in is loaded in an Outlook.com or Gmail mailbox. * * **Warning**: `getAccessTokenAsync` has been deprecated. Use `Office.auth.getAccessToken` instead. * * @deprecated Use `Office.auth.getAccessToken` instead. * * @remarks * * **Applications**: Excel, OneNote, Outlook, PowerPoint, Word * * **Requirement set**: {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/identity-api-requirement-sets | IdentityAPI 1.3} * * This API requires a single sign-on configuration that bridges the add-in to an Azure application. Office users sign in with Organizational * Accounts and Microsoft Accounts. Microsoft Azure returns tokens intended for both user account types to access resources in the Microsoft Graph. * * @param options - Optional. Accepts an `AuthOptions` object to define sign-on behaviors. * @param callback - Optional. Accepts a callback function that can parse the token for the user's ID or use the token in the "on behalf of" flow to get access to Microsoft Graph. * If `AsyncResult.status` is "succeeded", then `AsyncResult.value` is the raw AAD v. 2.0-formatted access token. */ getAccessTokenAsync(options?: AuthOptions, callback?: (result: AsyncResult) => void): void; /** * Calls the Azure Active Directory V 2.0 endpoint to get an access token to your add-in's web application. Enables add-ins to identify users. * Server-side code can use this token to access Microsoft Graph for the add-in's web application by using the * {@link https://learn.microsoft.com/azure/active-directory/develop/active-directory-v2-protocols-oauth-on-behalf-of | "on behalf of" OAuth flow}. * * **Important**: In Outlook, this API isn't supported if the add-in is loaded in an Outlook.com or Gmail mailbox. * * **Warning**: `getAccessTokenAsync` has been deprecated. Use `Office.auth.getAccessToken` instead. * * @deprecated Use `Office.auth.getAccessToken` instead. * * @remarks * * **Applications**: Excel, OneNote, Outlook, PowerPoint, Word * * **Requirement set**: {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/identity-api-requirement-sets | IdentityAPI 1.3} * * This API requires a single sign-on configuration that bridges the add-in to an Azure application. Office users sign in with Organizational * Accounts and Microsoft Accounts. Microsoft Azure returns tokens intended for both user account types to access resources in the Microsoft Graph. * * @param callback - Optional. Accepts a callback function that can parse the token for the user's ID or use the token in the "on behalf of" flow to get access to Microsoft Graph. * If `AsyncResult.status` is "succeeded", then `AsyncResult.value` is the raw AAD v. 2.0-formatted access token. */ getAccessTokenAsync(callback?: (result: AsyncResult) => void): void; /** * Calls the Azure Active Directory V 2.0 endpoint to get an access token to your add-in's web application. Enables add-ins to identify users. * Server-side code can use this token to access Microsoft Graph for the add-in's web application by using the * {@link https://learn.microsoft.com/azure/active-directory/develop/active-directory-v2-protocols-oauth-on-behalf-of | "on behalf of" OAuth flow}. * This API requires a single sign-on configuration that bridges the add-in to an Azure application. Office users sign in with Organizational * Accounts and Microsoft Accounts. Microsoft Azure returns tokens intended for both user account types to access resources in the Microsoft Graph. * * @remarks * * **Applications**: Excel, OneNote, Outlook, PowerPoint, Word * * **Requirement set**: {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/identity-api-requirement-sets | IdentityAPI 1.3} * * **Important**: * * - In Outlook, this API isn't supported if you load an add-in in an Outlook.com or Gmail mailbox. * * - In Outlook on the web, this API isn't supported if you use the Safari browser. This results in error 13001 ("The user is not signed into Office"). * * - In Outlook on the web, if you use the * {@link https://learn.microsoft.com/javascript/api/office/office.ui#office-office-ui-displaydialogasync-member(1) | displayDialogAsync} * method to open a dialog, you must close the dialog before you can call `getAccessToken`. * * - In an Outlook event-based activation add-in, this API is supported in Outlook on Windows starting from Version 2111 (Build 14701.20000). * To retrieve an access token in older builds, use * {@link https://learn.microsoft.com/javascript/api/office-runtime/officeruntime.auth?view=common-js-preview#office-runtime-officeruntime-auth-getaccesstoken-member(1) | * OfficeRuntime.auth.getAccessToken} instead. For more information, see * {@link https://learn.microsoft.com/office/dev/add-ins/outlook/use-sso-in-event-based-activation | Enable single sign-on (SSO) in Outlook add-ins that use event-based activation}. * * @param options - Optional. Accepts an `AuthOptions` object to define sign-on behaviors. * @returns Promise to the access token. */ getAccessToken(options?: AuthOptions): Promise; } /** * Provides options for the user experience when Office obtains an access token to the add-in from AAD v. 2.0 with the `getAccessToken` method. */ interface AuthOptions { /** * Allows Office to get an access token silently or through interactive consent, if one is required. Default value is `false`. * If set to `false`, Office will silently try to get an access token. If it fails to do so, Office will return a descriptive error. * If set to `true`, Office will show an interactive consent UI after it fails to silently get an access token. * The prompt will only allow consent to the AAD profile scope, not to any Microsoft Graph scopes. */ allowConsentPrompt?: boolean; /** * Allows Office to get an access token silently provided consent is present or show interactive UI to sign in the user. Default value is `false`. * If set to `false`, Office will silently try to get an access token. If it fails to do so, Office will return a descriptive error. * If set to `true`, Office will show an interactive sign-in UI after it fails to silently get an access token. */ allowSignInPrompt?: boolean; /** * Prompts the user to add their Office account (or to switch to it, if it is already added). Default value is `false`. * * **Warning**: `forceAddAccount` has been deprecated. Use `allowSignInPrompt` instead. * * @deprecated Use `allowSignInPrompt` instead. */ forceAddAccount?: boolean; /** * Causes Office to display the add-in consent experience. Useful if the add-in's Azure permissions have changed or if the user's consent has * been revoked. Default value is `false`. * * **Warning**: `forceConsent` has been deprecated. Use `allowConsentPrompt` instead. * * @deprecated Use `allowConsentPrompt` instead. */ forceConsent?: boolean; /** * Causes Office to prompt the user to provide the additional factor when the tenancy being targeted by Microsoft Graph requires multifactor * authentication. The string value identifies the type of additional factor that is required. In most cases, you won't know at development * time whether the user's tenant requires an additional factor or what the string should be. So this option would be used in a "second try" * call of `getAccessToken` after Microsoft Graph has sent an error requesting the additional factor and containing the string that should * be used with the `authChallenge` option. */ authChallenge?: string; /** * A user-defined item of any type that is returned, unchanged, in the `asyncContext` property of the `AsyncResult` object that is passed to a callback. */ asyncContext?: any; /** * Causes Office to return a descriptive error when the add-in wants to access Microsoft Graph and the user/admin has not granted consent to Graph scopes. Default value is `false`. * Office only supports consent to Graph scopes when the add-in has been deployed by a tenant admin. * Setting this option to `true` will cause Office to inform your add-in beforehand (by returning a descriptive error) if Graph access will fail. * * @remarks * * **Note**: If you're developing an Outlook add-in that uses single sign-on (SSO), comment out the `forMSGraphAccess` option before sideloading the add-in for testing. * Otherwise, you'll receive {@link https://learn.microsoft.com/office/dev/add-ins/develop/troubleshoot-sso-in-office-add-ins#13012 | error 13012}. For additional guidance, see * {@link https://learn.microsoft.com/office/dev/add-ins/develop/authorize-to-microsoft-graph#details-on-sso-with-an-outlook-add-in | Details on SSO with an Outlook add-in}. */ forMSGraphAccess?: boolean; } /** * Provides an option for preserving context data of any type, unchanged, for use in a callback. */ interface AsyncContextOptions { /** * A user-defined item of any type that is returned, unchanged, in the `asyncContext` property of the `AsyncResult` object * that is passed to a callback. */ asyncContext?: any } /** * Provides information about the environment in which the add-in is running. * * @remarks * **Important**: In Outlook, this object is available from Mailbox requirement set 1.5. * For all Mailbox requirement sets, you can use the * {@link https://learn.microsoft.com/javascript/api/outlook/office.mailbox?view=outlook-js-preview&preserve-view=true#outlook-office-mailbox-diagnostics-member | Office.context.mailbox.diagnostics} * property to get similar information. */ interface ContextInformation { /** * Gets the Office application in which the add-in is running. */ host: Office.HostType; /** * Gets the platform on which the add-in is running. */ platform: Office.PlatformType; /** * Gets the version of Office on which the add-in is running. */ version: string; } /** * Provides options for how to get the data in a binding. * * @remarks * * If the rows option is used, the value must be "thisRow". */ interface GetBindingDataOptions { /** * The expected shape of the selection. Use {@link Office.CoercionType} or text value. Default: The original, uncoerced type of the binding. */ coercionType?: Office.CoercionType | string /** * Specifies whether values, such as numbers and dates, are returned with their formatting applied. Use Office.ValueFormat or text value. * Default: Unformatted data. */ valueFormat?: Office.ValueFormat | string /** * For table or matrix bindings, specifies the zero-based starting row for a subset of the data in the binding. Default is first row. */ startRow?: number /** * For table or matrix bindings, specifies the zero-based starting column for a subset of the data in the binding. Default is first column. */ startColumn?: number /** * For table or matrix bindings, specifies the number of rows offset from the startRow. Default is all subsequent rows. */ rowCount?: number /** * For table or matrix bindings, specifies the number of columns offset from the startColumn. Default is all subsequent columns. */ columnCount?: number /** * Specify whether to get only the visible (filtered in) data or all the data (default is all). Useful when filtering data. * Use Office.FilterType or text value. */ filterType?: Office.FilterType | string /** * Only for table bindings in content add-ins for Access. Specifies the pre-defined string "thisRow" to get data in the currently selected row. * * **Important**: We no longer recommend that you create and use Access web apps and databases in SharePoint. * As an alternative, we recommend that you use {@link https://powerapps.microsoft.com/ | Microsoft PowerApps} * to build no-code business solutions for web and mobile devices. */ rows?: string /** * A user-defined item of any type that is returned, unchanged, in the asyncContext property of the AsyncResult object that is passed to a callback. */ asyncContext?: any } /** * Provides options for how to set the data in a binding. * * @remarks * * If the rows option is used, the value must be "thisRow". */ interface SetBindingDataOptions { /** * Use only with binding type table and when a TableData object is passed for the data parameter. An array of objects that specify a range of * columns, rows, or cells and specify, as key-value pairs, the cell formatting to apply to that range. * * Example: `[{cells: Office.Table.Data, format: {fontColor: "yellow"}}, {cells: {row: 3, column: 4}, format: {borderColor: "white", fontStyle: "bold"}}]` */ cellFormat?: RangeFormatConfiguration[] /** * Explicitly sets the shape of the data object. If not supplied is inferred from the data type. */ coercionType?: Office.CoercionType | string /** * Only for table bindings in content add-ins for Access. Array of strings. Specifies the column names. * * **Important**: We no longer recommend that you create and use Access web apps and databases in SharePoint. * As an alternative, we recommend that you use {@link https://powerapps.microsoft.com/ | Microsoft PowerApps} * to build no-code business solutions for web and mobile devices. */ columns?: string[] /** * Only for table bindings in content add-ins for Access. Specifies the pre-defined string "thisRow" to get data in the currently selected row. * * **Important**: We no longer recommend that you create and use Access web apps and databases in SharePoint. * As an alternative, we recommend that you use {@link https://powerapps.microsoft.com/ | Microsoft PowerApps} * to build no-code business solutions for web and mobile devices. */ rows?: string /** * Specifies the zero-based starting row for a subset of the data in the binding. Only for table or matrix bindings. If omitted, data is set * starting in the first row. */ startRow?: number /** * Specifies the zero-based starting column for a subset of the data. Only for table or matrix bindings. If omitted, data is set starting in * the first column. */ startColumn?: number /** * For an inserted table, a list of key-value pairs that specify table formatting options, such as header row, total row, and banded rows. * Example: `{bandedRows: true, filterButton: false}` */ tableOptions?: object /** * A user-defined item of any type that is returned, unchanged, in the asyncContext property of the AsyncResult object that is passed to a callback. */ asyncContext?: any } /** * Specifies a range and its formatting. */ interface RangeFormatConfiguration { /** * Specifies the range. Example of using Office.Table enum: Office.Table.All. Example of using RangeCoordinates: `{row: 3, column: 4}` specifies * the cell in the 3rd (zero-based) row in the 4th (zero-based) column. */ cells: Office.Table | RangeCoordinates /** * Specifies the formatting as key-value pairs. Example: `{borderColor: "white", fontStyle: "bold"}` */ format: object } /** * Specifies a cell, or row, or column, by its zero-based row and/or column number. Example: `{row: 3, column: 4}` specifies the cell in the 3rd * (zero-based) row in the 4th (zero-based) column. */ interface RangeCoordinates { /** * The zero-based row of the range. If not specified, all cells, in the column specified by `column` are included. */ row?: number /** * The zero-based column of the range. If not specified, all cells, in the row specified by `row` are included. */ column?: number } /** * Provides options to determine which event handler or handlers are removed. */ interface RemoveHandlerOptions { /** * The handler to be removed. If a particular handler is not specified, then all handlers for the specified event type are removed. */ handler?: (eventArgs?: Office.BindingDataChangedEventArgs | Office.BindingSelectionChangedEventArgs) => any /** * A user-defined item of any type that is returned, unchanged, in the asyncContext property of the AsyncResult object that is passed to a callback. */ asyncContext?: any } /** * Provides options for configuring the binding that is created. */ interface AddBindingFromNamedItemOptions { /** * The unique ID of the binding. Autogenerated if not supplied. */ id?: string /** * A user-defined item of any type that is returned, unchanged, in the asyncContext property of the AsyncResult object that is passed to a callback. */ asyncContext?: any } /** * Provides options for configuring the prompt and identifying the binding that is created. */ interface AddBindingFromPromptOptions { /** * The unique ID of the binding. Autogenerated if not supplied. */ id?: string /** * Specifies the string to display in the prompt UI that tells the user what to select. Limited to 200 characters. * If no promptText argument is passed, "Please make a selection" is displayed. */ promptText?: string /** * Specifies a table of sample data displayed in the prompt UI as an example of the kinds of fields (columns) that can be bound by your add-in. * The headers provided in the TableData object specify the labels used in the field selection UI. * * **Note**: This parameter is used only in add-ins for Access. It is ignored if provided when calling the method in an add-in for Excel. * * **Important**: We no longer recommend that you create and use Access web apps and databases in SharePoint. * As an alternative, we recommend that you use {@link https://powerapps.microsoft.com/ | Microsoft PowerApps} * to build no-code business solutions for web and mobile devices. */ sampleData?: Office.TableData /** * A user-defined item of any type that is returned, unchanged, in the asyncContext property of the AsyncResult object that is passed to a callback. */ asyncContext?: any } /** * Provides options for identifying the binding that is created. */ interface AddBindingFromSelectionOptions { /** * The unique ID of the binding. Autogenerated if not supplied. */ id?: string /** * The names of the columns involved in the binding. */ columns?: string[] /** * A user-defined item of any type that is returned, unchanged, in the asyncContext property of the AsyncResult object that is passed to a callback. */ asyncContext?: any } /** * Provides options for setting the size of slices that the document will be divided into. */ interface GetFileOptions { /** * The size of the slices in bytes. The maximum (and the default) is 4194304 (4MB). */ sliceSize?: number /** * A user-defined item of any type that is returned, unchanged, in the asyncContext property of the AsyncResult object that is passed to a callback. */ asyncContext?: any } /** * Provides options for customizing what data is returned and how it is formatted. */ interface GetSelectedDataOptions { /** * Specify whether the data is formatted. Use Office.ValueFormat or string equivalent. */ valueFormat?: Office.ValueFormat | string /** * Specify whether to get only the visible (that is, filtered-in) data or all the data. Useful when filtering data. * Use {@link Office.FilterType} or string equivalent. This parameter is ignored in Word documents. */ filterType?: Office.FilterType | string /** * A user-defined item of any type that is returned, unchanged, in the asyncContext property of the AsyncResult object that is passed to a callback. */ asyncContext?: any } /** * Provides options for whether to select the location that is navigated to. * * @remarks * * The behavior caused by the {@link Office.SelectionMode | options.selectionMode} option varies by Office application: * * In Excel: `Office.SelectionMode.Selected` selects all content in the binding, or named item. `Office.SelectionMode.None` for text bindings, * selects the cell; for matrix bindings, table bindings, and named items, selects the first data cell (not first cell in header row for tables). * * In PowerPoint: `Office.SelectionMode.Selected` selects the slide title or first textbox on the slide. * `Office.SelectionMode.None` doesn't select anything. * * In Word: `Office.SelectionMode.Selected` selects all content in the binding. `Office.SelectionMode.None` for text bindings, moves the cursor to * the beginning of the text; for matrix bindings and table bindings, selects the first data cell (not first cell in header row for tables). */ interface GoToByIdOptions { /** * Specifies whether the location specified by the `id` parameter is selected (highlighted). * Use {@link Office.SelectionMode} or string equivalent. See the Remarks for more information. */ selectionMode?: Office.SelectionMode | string /** * A user-defined item of any type that is returned, unchanged, in the asyncContext property of the AsyncResult object that is passed to a callback. */ asyncContext?: any } /** * Provides options for how to insert data to the selection. */ interface SetSelectedDataOptions { /** * Use only with binding type table and when a TableData object is passed for the data parameter. An array of objects that specify a range of * columns, rows, or cells and specify, as key-value pairs, the cell formatting to apply to that range. * * Example: `[{cells: Office.Table.Data, format: {fontColor: "yellow"}}, {cells: {row: 3, column: 4}, format: {borderColor: "white", fontStyle: "bold"}}]` */ cellFormat?: RangeFormatConfiguration[] /** * Explicitly sets the shape of the data object. If not supplied is inferred from the data type. */ coercionType?: Office.CoercionType | string /** * For an inserted table, a list of key-value pairs that specify table formatting options, such as header row, total row, and banded rows. * Example: `{bandedRows: true, filterButton: false}` */ tableOptions?: object /** * This option is applicable for inserting images. Indicates the insert location in relation to the top of the slide for PowerPoint, and its * relation to the currently selected cell in Excel. This value is ignored for Word. This value is in points. */ imageTop?: number /** * This option is applicable for inserting images. Indicates the image width. If this option is provided without the imageHeight, the image * will scale to match the value of the image width. If both image width and image height are provided, the image will be resized accordingly. * If neither the image height or width is provided, the default image size and aspect ratio will be used. This value is in points. */ imageWidth?: number /** * This option is applicable for inserting images. Indicates the insert location in relation to the left side of the slide for PowerPoint, and * its relation to the currently selected cell in Excel. This value is ignored for Word. This value is in points. */ imageLeft?: number /** * This option is applicable for inserting images. Indicates the image height. If this option is provided without the imageWidth, the image * will scale to match the value of the image height. If both image width and image height are provided, the image will be resized accordingly. * If neither the image height or width is provided, the default image size and aspect ratio will be used. This value is in points. */ imageHeight?: number /** * A user-defined item of any type that is returned, unchanged, in the asyncContext property of the AsyncResult object that is passed to a callback. */ asyncContext?: any } /** * Provides options for saving settings. */ interface SaveSettingsOptions { /** * **Warning**: This setting has been deprecated and should not be used. It has no effect on most platforms and will cause errors if set to `false` in Excel on the web. * * @deprecated `overwriteIfStale` is no longer supported. */ overwriteIfStale?: boolean /** * A user-defined item of any type that is returned, unchanged, in the asyncContext property of the AsyncResult object that is passed to a callback. */ asyncContext?: any } /** * Provides access to the properties for Office theme colors. * * Using Office theme colors lets you coordinate the color scheme of your add-in with the current Office theme selected by the user with **File** \> * **Office Account** \> **Office Theme UI**, which is applied across all Office applications. Using Office theme colors is appropriate for mail and * task pane add-ins. * * @remarks * * *Supported applications, by platform* * * * * * * *
Office on Windows Office on the web
Excel Supported
Outlook Preview
PowerPoint Supported
Word Supported Supported
*/ interface OfficeTheme { /** * Gets the Office theme body background color as a hexadecimal color triplet (e.g., "#FFA500"). */ bodyBackgroundColor: string; /** * Gets the Office theme body foreground color as a hexadecimal color triplet (e.g., "#FFA500"). */ bodyForegroundColor: string; /** * Gets the Office theme control background color as a hexadecimal color triplet (e.g., "#FFA500"). */ controlBackgroundColor: string; /** * Gets the Office theme control foreground color as a hexadecimal color triplet (e.g., "#FFA500"). */ controlForegroundColor: string; } /** * The object that is returned when `UI.displayDialogAsync` is called. It exposes methods for registering event handlers and closing the dialog. * * @remarks * * **Requirement set**: {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/dialog-api-requirement-sets | DialogApi} */ interface Dialog { /** * Called from a parent page to close the corresponding dialog box. * * This method is asynchronous. It does not take a callback parameter and it does not return a Promise object, so it cannot be awaited with either the `await` keyword or the `then` function. See this best practice for more information: {@link https://learn.microsoft.com/office/dev/add-ins/develop/dialog-best-practices#opening-another-dialog-immediately-after-closing-one | Opening another dialog immediately after closing one} */ close(): void; /** * Registers an event handler. The two supported events are: * * - DialogMessageReceived. Triggered when the dialog box sends a message to its parent. * * - DialogEventReceived. Triggered when the dialog box has been closed or otherwise unloaded. * * @param eventType Must be either DialogMessageReceived or DialogEventReceived. * @param handler A function which accepts either an object with a `message` and `origin` property, if `eventType` is `DialogMessageReceived`, or an object with an `error` property, if `eventType` is `DialogEventReceived`. Note that the `origin` property is `undefined` on clients that don’t support {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/dialog-origin-requirement-sets | DialogOrigin 1.1}. */ addEventHandler(eventType: Office.EventType, handler: (args: {message: string, origin: string | undefined} | {error: number}) => void): void; /** * Delivers a message from the host page, such as a task pane or a UI-less function file, to a dialog that was opened from the page. * * @remarks * * **Applications**: Excel, Outlook (Minimum requirement set: Mailbox 1.9), PowerPoint, Word * * **Requirement sets**: * * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/dialog-api-requirement-sets | DialogApi 1.2} * * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/outlook/outlook-api-requirement-sets | Mailbox 1.9} * * - If the `messageOptions` parameter is used, {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/dialog-origin-requirement-sets | DialogOrigin 1.1} is also required. * * @param message Accepts a message from the host page to deliver to the dialog. Anything that can be serialized to a string, including JSON and XML, can be sent. * @param messageOptions Optional. Provides options for how to send the message. */ messageChild(message: string, messageOptions?: DialogMessageOptions): void; /** * FOR INTERNAL USE ONLY. DO NOT CALL IN YOUR CODE. */ sendMessage(name: string): void; } /** * Returns a promise of an object described in the expression. Callback is invoked only if the function fails. * * @param expression The object to be retrieved. Example "bindings#BindingName", retrieves a binding promise for a binding named 'BindingName' * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. * * @remarks * * **Support details** * * For more information about Office application and server requirements, see * {@link https://learn.microsoft.com/office/dev/add-ins/concepts/requirements-for-running-office-add-ins | Requirements for running Office Add-ins}. * * *Supported applications, by platform* * * * * *
Office on Windows Office in web browser Office on iPad
Excel Supported Supported Supported
Word Supported Supported
*/ function select(expression: string, callback?: (result: AsyncResult) => void): Binding; // Enumerations /** * Specifies the state of the active view of the document, for example, whether the user can edit the document. */ enum ActiveView { /** * The active view of the Office application only lets the user read the content in the document. */ Read, /** * The active view of the Office application lets the user edit the content in the document. */ Edit } /** * Specifies the type of the binding object that should be returned. */ enum BindingType { /** * Plain text. Data is returned as a run of characters. */ Text, /** * Tabular data without a header row. Data is returned as an array of arrays, for example in this form: * [[row1column1, row1column2],[row2column1, row2column2]] */ Matrix, /** * Tabular data with a header row. Data is returned as a {@link Office.TableData | TableData} object. */ Table } /** * Specifies how to coerce data returned or set by the invoked method. * * @remarks * * Application and platform support for each `CoercionType` is specified in the following requirement set descriptions. * * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#htmlcoercion | HtmlCoercion}, (when using `Office.CoercionType.Html`) * * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/image-coercion-requirement-sets | ImageCoercion 1.1} (when using `Office.CoercionType.Image`) * * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#matrixcoercion | MatrixCoercion} (when using `Office.CoercionType.Matrix`) * * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#ooxmlcoercion | OoxmlCoercion} (when using `Office.CoercionType.Ooxml`) * * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#selection | Selection} * * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#tablecoercion | TableCoercion} (when using `Office.CoercionType.Table`) * * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#textcoercion | TextCoercion} (when using `Office.CoercionType.Text`) * * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/image-coercion-requirement-sets#imagecoercion-12 | ImageCoercion 1.2} (when using `Office.CoercionType.XmlSvg`) * */ enum CoercionType { /** * Return or set data as text (string). Data is returned or set as a one-dimensional run of characters. */ Text, /** * Return or set data as tabular data with no headers. Data is returned or set as an array of arrays containing one-dimensional runs of * characters. For example, three rows of string values in two columns would be: [["R1C1", "R1C2"], ["R2C1", "R2C2"], ["R3C1", "R3C2"]]. * * **Note**: Only applies to data in Excel and Word. */ Matrix, /** * Return or set data as tabular data with optional headers. Data is returned or set as an array of arrays with optional headers. * * **Note**: Only applies to data in Excel and Word. */ Table, /** * Return or set data as HTML. * * **Note**: Only applies to data in add-ins for Word and Outlook add-ins for Outlook (compose mode). */ Html, /** * Return or set data as Office Open XML. * * **Note**: Only applies to data in Word. */ Ooxml, /** * Return a JSON object that contains an array of the IDs, titles, and indexes of the selected slides. For example, * `{"slides":[{"id":257,"title":"Slide 2","index":2},{"id":256,"title":"Slide 1","index":1}]}` for a selection of two slides. * * **Note**: Only applies to data in PowerPoint when calling the {@link Office.Document | Document}.getSelectedData method to get the current * slide or selected range of slides. */ SlideRange, /** * Data is returned or set as an image stream. * **Note**: Only applies to data in Excel, Word, and PowerPoint. */ Image, /** * Data is returned or set as XML data containing an SVG image. * **Note**: Only applies to data in Excel, Word, and PowerPoint. */ XmlSvg } /** * Specifies whether the document in the associated application is read-only or read-write. * * @remarks * * Returned by the mode property of the {@link Office.Document | Document} object. */ enum DocumentMode { /** * The document is read-only. */ ReadOnly, /** * The document can be read and written to. */ ReadWrite } /** * Specifies the type of the XML node. */ enum CustomXMLNodeType { /** * The node is an attribute. */ Attribute, /** * The node is CData. */ CData, /** * The node is a comment. */ NodeComment, /** * The node is an element. */ Element, /** * The node is a Document element. */ NodeDocument, /** * The node is a processing instruction. */ ProcessingInstruction, /** * The node is text. */ Text, } /** * Specifies the kind of event that was raised. Returned by the `type` property of an `*EventArgs` object. * * Add-ins for Project support the `Office.EventType.ResourceSelectionChanged`, `Office.EventType.TaskSelectionChanged`, and * `Office.EventType.ViewSelectionChanged` event types. * * Only task pane add-ins for Outlook support Mailbox API set event types. * * @remarks * * **`BindingDataChanged` and `BindingSelectionChanged` applications**: Excel, Word. * */ enum EventType { /** * A Document.ActiveViewChanged event was raised in PowerPoint. * * @remarks * * **Applications**: PowerPoint */ ActiveViewChanged, /** * Occurs when any date or time of the selected appointment or series is changed in Outlook. * **Important**: This event can only be handled in a task pane. It isn't supported by function commands. * * To add an event handler for the `AppointmentTimeChanged` event, use the `addHandlerAsync` method of the `Item` object. * The event handler receives an argument of type * {@link https://learn.microsoft.com/javascript/api/outlook/office.appointmenttimechangedeventargs?view=outlook-js-1.7 | Office.AppointmentTimeChangedEventArgs}. * * [Api set: Mailbox 1.7] */ AppointmentTimeChanged, /** * Occurs when an attachment is added to or removed from an item. **Important**: This event can only be handled in a task pane. It isn't supported by function commands. * * To add an event handler for the `AttachmentsChanged` event, use the `addHandlerAsync` method of the `Item` object. * The event handler receives an argument of type * {@link https://learn.microsoft.com/javascript/api/outlook/office.attachmentschangedeventargs?view=outlook-js-1.8 | Office.AttachmentsChangedEventArgs}. * * [Api set: Mailbox 1.8] */ AttachmentsChanged, /** * Occurs when data within the binding is changed. * To add an event handler for the BindingDataChanged event of a binding, use the addHandlerAsync method of the Binding object. * The event handler receives an argument of type {@link Office.BindingDataChangedEventArgs}. * * @remarks * * **Applications**: Excel, Word */ BindingDataChanged, /** * Occurs when the selection is changed within the binding. To add an event handler for the BindingSelectionChanged event of a binding, use * the addHandlerAsync method of the Binding object. The event handler receives an argument of type {@link Office.BindingSelectionChangedEventArgs}. * * @remarks * * **Applications**: Excel, Word */ BindingSelectionChanged, /** * Triggers when Dialog has an event, such as dialog closed or dialog navigation failed. */ DialogEventReceived, /** * Triggers when a dialog sends a message via `messageParent`. */ DialogMessageReceived, /** * Triggers when a host page sends a message to a child dialog box with `messageChild`. */ DialogParentMessageReceived, /** * Triggers when a document-level selection happens. * * @remarks * * **Applications**: Excel, Word */ DocumentSelectionChanged, /** * Occurs when the appointment location is changed in Outlook. **Important**: This event can only be handled in a task pane. It isn't supported by function commands. * * To add an event handler for the `EnhancedLocationsChanged` event, use the `addHandlerAsync` method of the `Item` object. * The event handler receives an argument of type * {@link https://learn.microsoft.com/javascript/api/outlook/office.enhancedlocationschangedeventargs?view=outlook-js-1.8 | Office.EnhancedLocationsChangedEventArgs}. * * [Api set: Mailbox 1.8] */ EnhancedLocationsChanged, /** * Occurs in Outlook when an action is selected on a notification message with a defined * {@link https://learn.microsoft.com/javascript/api/outlook/office.notificationmessagedetails#actions | custom action}. * Currently, "Dismiss" is the only supported action that fires this event. * * **Important**: This event can only be handled in a task pane. It isn't supported by function commands. * * To add an event handler for the `InfobarClicked` event, use the `addHandlerAsync` method of the `Item` object. * The event handler receives an argument of type * {@link https://learn.microsoft.com/javascript/api/outlook/office.infobarclickedeventargs?view=outlook-js-1.10 | Office.InfobarClickedEventArgs}. * * [Api set: Mailbox 1.10] */ InfobarClicked, /** * Occurs when a different Outlook item is selected for viewing while the task pane is pinned. * **Important**: This event can only be handled in a task pane. It isn't supported by function commands. * * To add an event handler for the `ItemChanged` event, use the `addHandlerAsync` method of the `Mailbox` object. * * [Api set: Mailbox 1.5] */ ItemChanged, /** * Triggers when a customXmlPart node is deleted. */ NodeDeleted, /** * Triggers when a customXmlPart node is inserted. */ NodeInserted, /** * Triggers when a customXmlPart node is replaced. */ NodeReplaced, /** * Occurs when the OfficeTheme is changed in Outlook. **Important**: This event can only be handled in a task pane. It isn't supported by function commands. * * To add an event handler for the `OfficeThemeChanged` event, use the `addHandlerAsync` method of the `Mailbox` object. * The event handler receives an argument of type * {@link https://learn.microsoft.com/javascript/api/outlook/office.officethemechangedeventargs?view=outlook-js-preview | Office.OfficeThemeChangedEventArgs}. * * [Api set: Mailbox preview] * * @beta */ OfficeThemeChanged, /** * Occurs when the recipient list of the selected item or the appointment location is changed in Outlook. * **Important**: This event can only be handled in a task pane. It isn't supported by function commands. * * To add an event handler for the `RecipientsChanged` event, use the `addHandlerAsync` method of the `Item` object. * The event handler receives an argument of type * {@link https://learn.microsoft.com/javascript/api/outlook/office.recipientschangedeventargs?view=outlook-js-1.7 | Office.RecipientsChangedEventArgs}. * * [Api set: Mailbox 1.7] */ RecipientsChanged, /** * Occurs when the recurrence pattern of the selected series is changed in Outlook. * **Important**: This event can only be handled in a task pane. It isn't supported by function commands. * * To add an event handler for the `RecurrenceChanged` event, use the `addHandlerAsync` method of the `Item` object. * The event handler receives an argument of type * {@link https://learn.microsoft.com/javascript/api/outlook/office.recurrencechangedeventargs?view=outlook-js-1.7 | Office.RecurrenceChangedEventArgs}. * * [Api set: Mailbox 1.7] */ RecurrenceChanged, /** * Triggers when a Resource selection happens in Project. */ ResourceSelectionChanged, /** * Occurs in Outlook when one or more messages are selected or deselected. * **Important**: This event can only be handled in a task pane. It isn't supported by function commands. * * To add an event handler for the `SelectedItemsChanged` event, use the `addHandlerAsync` method of the `Mailbox` object. * * [Api set: Mailbox 1.13] */ SelectedItemsChanged, /** * Occurs in Outlook when the sensitivity label of a message or appointment changes. * **Important**: This event can only be handled in a task pane. It isn't supported by function commands. * * To add an event handler for the `SensitivityLabelChanged` event, use the `addHandlerAsync` method of the `Item` object. * The event handler receives an argument of type * {@link https://learn.microsoft.com/javascript/api/outlook/office.sensitivitylabelchangedeventargs | Office.SensitivityLabelChangedEventArgs}. * * [Api set: Mailbox 1.13] */ SensitivityLabelChanged, /** * A Settings.settingsChanged event was raised. * * @remarks * * **Applications**: Excel, PowerPoint, Word */ SettingsChanged, /** * Occurs in Outlook when an unsolicited message is reported. The event handler receives an argument of type * {@link https://learn.microsoft.com/javascript/api/outlook/office.spamreportingeventargs?view=outlook-js-preview&preserve-view=true | Office.SpamReportingEventArgs}. * * [Api set: Mailbox preview] * * @beta */ SpamReporting, /** * Triggers when a Task selection happens in Project. */ TaskSelectionChanged, /** * Triggers when a View selection happens in Project. */ ViewSelectionChanged } /** * Specifies the format in which to return the document. */ enum FileType { /** * Returns only the text of the document as a string. */ Text, /** * Returns the entire document (.pptx, .docx, .xlsx, or .xlsm) in Office Open XML (OOXML) format as a byte array. * * Note: The .xslm file type is supported in Excel on Windows and Mac. It's not supported in Excel on the web. * In Excel on Windows, the file slices from the `getFileAsync` method include the VBA signature files for .xslm file types. The VBA signature files are vbaProjectSignature.bin, vbaProbjectSignatureAgile.bin, and vbaProjectSignatureV3.bin. * In Excel on Mac, the file slices from the `getFileAsync` method don't include the VBA signature files, because this platform doesn't support the VBA signature feature. */ Compressed, /** * Returns the entire document in PDF format as a byte array. */ Pdf } /** * Specifies whether filtering from the Office application is applied when the data is retrieved. */ enum FilterType { /** * Return all data (not filtered by the Office application). */ All, /** * Return only the visible data (as filtered by the Office application). */ OnlyVisible } /** * Specifies the type of place or object to navigate to. */ enum GoToType { /** * Goes to a binding object using the specified binding ID. * * Supported applications: Excel, Word */ Binding, /** * Goes to a named item using that item's name. * In Excel, you can use any structured reference for a named range or table: "Worksheet2!Table1" * * Supported applications: Excel */ NamedItem, /** * Goes to a slide using the specified ID. * * Supported applications: PowerPoint */ Slide, /** * Goes to the specified index by slide number or {@link Office.Index}. * * Supported applications: PowerPoint */ Index } /** * Specifies the relative PowerPoint slide. */ enum Index { /** * Represents the first PowerPoint slide */ First, /** * Represents the last PowerPoint slide */ Last, /** * Represents the next PowerPoint slide */ Next, /** * Represents the previous PowerPoint slide */ Previous } /** * Specifies whether to select (highlight) the location to navigate to (when using the {@link Office.Document | Document}.goToByIdAsync method). */ enum SelectionMode { Default, /** * The location will be selected (highlighted). */ Selected, /** * The cursor is moved to the beginning of the location. */ None } /** * Specifies whether values, such as numbers and dates, returned by the invoked method are returned with their formatting applied. * * @remarks * * For example, if the valueFormat parameter is specified as "formatted", a number formatted as currency, or a date formatted as mm/dd/yy in the * Office application will have its formatting preserved. If the valueFormat parameter is specified as "unformatted", a date will be returned in its * underlying sequential serial number form. */ enum ValueFormat { /** * Return unformatted data. */ Unformatted, /** * Return formatted data. */ Formatted } // Objects /** * Represents a binding to a section of the document. * * The Binding object exposes the functionality possessed by all bindings regardless of type. * * The Binding object is never called directly. It is the abstract parent class of the objects that represent each type of binding: * {@link Office.MatrixBinding}, {@link Office.TableBinding}, or {@link Office.TextBinding}. All three of these objects inherit the getDataAsync * and setDataAsync methods from the Binding object that enable to you interact with the data in the binding. They also inherit the ID and type * properties for querying those property values. Additionally, the MatrixBinding and TableBinding objects expose additional methods for matrix- * and table-specific features, such as counting the number of rows and columns. * * @remarks * * **Applications**: Word, Excel (deprecated, use {@link https://learn.microsoft.com/javascript/api/excel/excel.binding?view=excel-js-preview | Excel.Binding} instead) * * **Requirement sets**: * * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#matrixbindings | MatrixBindings} * * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#tablebindings | TableBindings} * * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#textbindings | TextBindings} */ interface Binding { /** * Get the Document object associated with the binding. */ document: Office.Document; /** * A string that uniquely identifies this binding among the bindings in the same {@link Office.Document} object. */ id: string; /** * Gets the type of the binding. */ type: Office.BindingType; /** * Adds an event handler to the object for the specified {@link Office.EventType}. Supported EventTypes are * `Office.EventType.BindingDataChanged` and `Office.EventType.BindingSelectionChanged`. * * @remarks * * **Requirement set**: {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#bindingevents | BindingEvents} * * You can add multiple event handlers for the specified eventType as long as the name of each event handler function is unique. * * @param eventType The event type. For bindings, it can be `Office.EventType.BindingDataChanged` or `Office.EventType.BindingSelectionChanged`. * @param handler The event handler function to add, whose only parameter is of type {@link Office.BindingDataChangedEventArgs} or {@link Office.BindingSelectionChangedEventArgs}. * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. */ addHandlerAsync(eventType: Office.EventType, handler: any, options?: Office.AsyncContextOptions, callback?: (result: Office.AsyncResult) => void): void; /** * Adds an event handler to the object for the specified {@link Office.EventType}. Supported EventTypes are * `Office.EventType.BindingDataChanged` and `Office.EventType.BindingSelectionChanged`. * * @remarks * * **Requirement set**: {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#bindingevents | BindingEvents} * * You can add multiple event handlers for the specified eventType as long as the name of each event handler function is unique. * * @param eventType The event type. For bindings, it can be `Office.EventType.BindingDataChanged` or `Office.EventType.BindingSelectionChanged`. * @param handler The event handler function to add, whose only parameter is of type {@link Office.BindingDataChangedEventArgs} or {@link Office.BindingSelectionChangedEventArgs}. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. */ addHandlerAsync(eventType: Office.EventType, handler: any, callback?: (result: Office.AsyncResult) => void): void; /** * Returns the data contained within the binding. * * @remarks * * **Requirement sets**: * * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#htmlcoercion | HtmlCoercion} (when using `Office.CoercionType.Html`) * * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#matrixbindings | MatrixBindings} * * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#matrixcoercion | MatrixCoercion} (when using `Office.CoercionType.Matrix`) * * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#ooxmlcoercion | OoxmlCoercion} (when using `Office.CoercionType.Ooxml`) * * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#tablebindings | TableBindings} * * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#tablecoercion | TableCoercion} (when using `Office.CoercionType.Table`) * * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#textbindings | TextBindings} * * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#textcoercion | TextCoercion} (when using `Office.CoercionType.Text`) * * When called from a MatrixBinding or TableBinding, the getDataAsync method will return a subset of the bound values if the optional startRow, * startColumn, rowCount, and columnCount parameters are specified (and they specify a contiguous and valid range). * * @param options Provides options for how to get the data in a binding. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. * The `value` property of the result is the values in the specified binding. * If the `coercionType` parameter is specified (and the call is successful), the data is returned in the format described in the CoercionType enumeration topic. */ getDataAsync(options?: GetBindingDataOptions, callback?: (result: AsyncResult) => void): void; /** * Returns the data contained within the binding. * * @remarks * * **Requirement sets**: * * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#htmlcoercion | HtmlCoercion} (when using `Office.CoercionType.Html`) * * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#matrixbindings | MatrixBindings} * * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#matrixcoercion | MatrixCoercion} (when using `Office.CoercionType.Matrix`) * * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#ooxmlcoercion | OoxmlCoercion} (when using `Office.CoercionType.Ooxml`) * * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#tablebindings | TableBindings} * * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#tablecoercion | TableCoercion} (when using `Office.CoercionType.Table`) * * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#textbindings | TextBindings} * * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#textcoercion | TextCoercion} (when using `Office.CoercionType.Text`) * * When called from a MatrixBinding or TableBinding, the getDataAsync method will return a subset of the bound values if the optional startRow, * startColumn, rowCount, and columnCount parameters are specified (and they specify a contiguous and valid range). * * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. * The `value` property of the result is the values in the specified binding. * If the `coercionType` parameter is specified (and the call is successful), the data is returned in the format described in the CoercionType enumeration topic. */ getDataAsync(callback?: (result: AsyncResult) => void): void; /** * Removes the specified handler from the binding for the specified event type. * * @remarks * * **Requirement set**: {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#bindingevents | BindingEvents} * * @param eventType The event type. For bindings, it can be `Office.EventType.BindingDataChanged` or `Office.EventType.BindingSelectionChanged`. * @param options Provides options to determine which event handler or handlers are removed. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. */ removeHandlerAsync(eventType: Office.EventType, options?: RemoveHandlerOptions, callback?: (result: AsyncResult) => void): void; /** * Removes the specified handler from the binding for the specified event type. * * @remarks * * **Requirement set**: {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#bindingevents | BindingEvents} * * @param eventType The event type. For bindings, it can be `Office.EventType.BindingDataChanged` or `Office.EventType.BindingSelectionChanged`. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. */ removeHandlerAsync(eventType: Office.EventType, callback?: (result: AsyncResult) => void): void; /** * Writes data to the bound section of the document represented by the specified binding object. * * @remarks * * **Requirement sets**: * * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#htmlcoercion | HtmlCoercion} (when using `Office.CoercionType.Html`) * * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#matrixbindings | MatrixBindings} * * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#matrixcoercion | MatrixCoercion} (when using `Office.CoercionType.Matrix`) * * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#ooxmlcoercion | OoxmlCoercion} (when using `Office.CoercionType.Ooxml`) * * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#tablebindings | TableBindings} * * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#tablecoercion | TableCoercion} (when using `Office.CoercionType.Table`) * * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#textbindings | TextBindings} * * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#textcoercion | TextCoercion} (when using `Office.CoercionType.Text`) * * The value passed for data contains the data to be written in the binding. The kind of value passed determines what will be written as * described in the following table. * * * * * * * * * * * * * * * * * * *
data valueData written
A stringPlain text or anything that can be coerced to a string will be written.
An array of arrays ("matrix")Tabular data without headers will be written. For example, to write data to three rows in two columns, you can pass an array like this: [["R1C1", "R1C2"], ["R2C1", "R2C2"], ["R3C1", "R3C2"]]. To write a single column of three rows, pass an array like this: [["R1C1"], ["R2C1"], ["R3C1"]].
A TableData objectA table with headers will be written.
* * Additionally, these application-specific actions apply when writing data to a binding. For Word, the specified data is written to the * binding as follows. * * * * * * * * * * * * * * * * * * * * * * *
data valueData written
A stringThe specified text is written.
An array of arrays ("matrix") or a TableData objectA Word table is written.
HTMLThe specified HTML is written. If any of the HTML you write is invalid, Word will not raise an error. Word will write as much of the HTML as it can and will omit any invalid data.
Office Open XML ("Open XML")The specified the XML is written.
* * For Excel, the specified data is written to the binding as follows. * * * * * * * * * * * * * * * * * * *
data valueData written
A stringThe specified text is inserted as the value of the first bound cell. You can also specify a valid formula to add that formula to the bound cell. For example, setting data to "=SUM(A1:A5)" will total the values in the specified range. However, when you set a formula on the bound cell, after doing so, you can't read the added formula (or any pre-existing formula) from the bound cell. If you call the Binding.getDataAsync method on the bound cell to read its data, the method can return only the data displayed in the cell (the formula's result).
An array of arrays ("matrix"), and the shape exactly matches the shape of the binding specifiedThe set of rows and columns are written.You can also specify an array of arrays that contain valid formulas to add them to the bound cells. For example, setting data to [["=SUM(A1:A5)","=AVERAGE(A1:A5)"]] will add those two formulas to a binding that contains two cells. Just as when setting a formula on a single bound cell, you can't read the added formulas (or any pre-existing formulas) from the binding with the Binding.getDataAsync method - it returns only the data displayed in the bound cells.
A TableData object, and the shape of the table matches the bound tableThe specified set of rows and/or headers are written, if no other data in surrounding cells will be overwritten. **Note**: If you specify formulas in the TableData object you pass for the *data* parameter, you might not get the results you expect due to the "calculated columns" feature of Excel, which automatically duplicates formulas within a column. To work around this when you want to write *data* that contains formulas to a bound table, try specifying the data as an array of arrays (instead of a TableData object), and specify the *coercionType* as Microsoft.Office.Matrix or "matrix".
* * For Excel on the web: * * - The total number of cells in the value passed to the data parameter can't exceed 20,000 in a single call to this method. * * - The number of formatting groups passed to the cellFormat parameter can't exceed 100. * A single formatting group consists of a set of formatting applied to a specified range of cells. * * In all other cases, an error is returned. * * The setDataAsync method will write data in a subset of a table or matrix binding if the optional startRow and startColumn parameters are * specified, and they specify a valid range. * * In the callback function passed to the setDataAsync method, you can use the properties of the AsyncResult object to return the following * information. * * * * * * * * * * * * * * * * * * * * * * *
PropertyUse
AsyncResult.valueAlways returns undefined because there is no object or data to retrieve
AsyncResult.statusDetermine the success or failure of the operation
AsyncResult.errorAccess an Error object that provides error information if the operation failed
AsyncResult.asyncContextDefine an item of any type that is returned in the AsyncResult object without being altered
* * @param data The data to be set in the current selection. Possible data types by Office application: * * string: Excel on the web and Windows, and Word on the web and Windows only * * array of arrays: Excel and Word only * * {@link Office.TableData}: Excel and Word only * * HTML: Word on the web and Windows only * * Office Open XML: Word only * * @param options Provides options for how to set the data in a binding. * * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. */ setDataAsync(data: TableData | any, options?: SetBindingDataOptions, callback?: (result: AsyncResult) => void): void; /** * Writes data to the bound section of the document represented by the specified binding object. * * @remarks * * **Requirement sets**: * * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#htmlcoercion | HtmlCoercion} (when using `Office.CoercionType.Html`) * * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#matrixbindings | MatrixBindings} * * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#matrixcoercion | MatrixCoercion} (when using `Office.CoercionType.Matrix`) * * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#ooxmlcoercion | OoxmlCoercion} (when using `Office.CoercionType.Ooxml`) * * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#tablebindings | TableBindings} * * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#tablecoercion | TableCoercion} (when using `Office.CoercionType.Table`) * * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#textbindings | TextBindings} * * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#textcoercion | TextCoercion} (when using `Office.CoercionType.Text`) * * The value passed for data contains the data to be written in the binding. The kind of value passed determines what will be written as * described in the following table. * * * * * * * * * * * * * * * * * * *
data valueData written
A stringPlain text or anything that can be coerced to a string will be written.
An array of arrays ("matrix")Tabular data without headers will be written. For example, to write data to three rows in two columns, you can pass an array like this: [["R1C1", "R1C2"], ["R2C1", "R2C2"], ["R3C1", "R3C2"]]. To write a single column of three rows, pass an array like this: [["R1C1"], ["R2C1"], ["R3C1"]].
A TableData objectA table with headers will be written.
* * Additionally, these application-specific actions apply when writing data to a binding. For Word, the specified data is written to the * binding as follows. * * * * * * * * * * * * * * * * * * * * * * *
data valueData written
A stringThe specified text is written.
An array of arrays ("matrix") or a TableData objectA Word table is written.
HTMLThe specified HTML is written. If any of the HTML you write is invalid, Word will not raise an error. Word will write as much of the HTML as it can and will omit any invalid data.
Office Open XML ("Open XML")The specified the XML is written.
* * For Excel, the specified data is written to the binding as follows. * * * * * * * * * * * * * * * * * * *
data valueData written
A stringThe specified text is inserted as the value of the first bound cell. You can also specify a valid formula to add that formula to the bound cell. For example, setting data to "=SUM(A1:A5)" will total the values in the specified range. However, when you set a formula on the bound cell, after doing so, you can't read the added formula (or any pre-existing formula) from the bound cell. If you call the Binding.getDataAsync method on the bound cell to read its data, the method can return only the data displayed in the cell (the formula's result).
An array of arrays ("matrix"), and the shape exactly matches the shape of the binding specifiedThe set of rows and columns are written.You can also specify an array of arrays that contain valid formulas to add them to the bound cells. For example, setting data to [["=SUM(A1:A5)","=AVERAGE(A1:A5)"]] will add those two formulas to a binding that contains two cells. Just as when setting a formula on a single bound cell, you can't read the added formulas (or any pre-existing formulas) from the binding with the Binding.getDataAsync method - it returns only the data displayed in the bound cells.
A TableData object, and the shape of the table matches the bound tableThe specified set of rows and/or headers are written, if no other data in surrounding cells will be overwritten. **Note**: If you specify formulas in the TableData object you pass for the *data* parameter, you might not get the results you expect due to the "calculated columns" feature of Excel, which automatically duplicates formulas within a column. To work around this when you want to write *data* that contains formulas to a bound table, try specifying the data as an array of arrays (instead of a TableData object), and specify the *coercionType* as Microsoft.Office.Matrix or "matrix".
* * For Excel on the web: * * - The total number of cells in the value passed to the data parameter can't exceed 20,000 in a single call to this method. * * - The number of formatting groups passed to the cellFormat parameter can't exceed 100. * A single formatting group consists of a set of formatting applied to a specified range of cells. * * In all other cases, an error is returned. * * The setDataAsync method will write data in a subset of a table or matrix binding if the optional startRow and startColumn parameters are * specified, and they specify a valid range. * * In the callback function passed to the setDataAsync method, you can use the properties of the AsyncResult object to return the following * information. * * * * * * * * * * * * * * * * * * * * * * *
PropertyUse
AsyncResult.valueAlways returns undefined because there is no object or data to retrieve
AsyncResult.statusDetermine the success or failure of the operation
AsyncResult.errorAccess an Error object that provides error information if the operation failed
AsyncResult.asyncContextDefine an item of any type that is returned in the AsyncResult object without being altered
* * @param data The data to be set in the current selection. Possible data types by Office application: * * string: Excel on the web and Windows, and Word on the web and Windows only * * array of arrays: Excel and Word only * * `TableData`: Excel and Word only * * HTML: Word on the web and Windows only * * Office Open XML: Word only * * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. */ setDataAsync(data: TableData | any, callback?: (result: AsyncResult) => void): void; } /** * Provides information about the binding that raised the DataChanged event. */ interface BindingDataChangedEventArgs { /** * Gets an {@link Office.Binding} object that represents the binding that raised the DataChanged event. */ binding: Binding; /** * Gets an {@link Office.EventType} enumeration value that identifies the kind of event that was raised. */ type: EventType; } /** * Provides information about the binding that raised the SelectionChanged event. */ interface BindingSelectionChangedEventArgs { /** * Gets an {@link Office.Binding} object that represents the binding that raised the SelectionChanged event. */ binding: Binding; /** * Gets the number of columns selected. If a single cell is selected returns 1. * * If the user makes a non-contiguous selection, the count for the last contiguous selection within the binding is returned. * * For Word, this property will work only for bindings of {@link Office.BindingType} "table". If the binding is of type "matrix", null is * returned. Also, the call will fail if the table contains merged cells, because the structure of the table must be uniform for this property * to work correctly. */ columnCount: number; /** * Gets the number of rows selected. If a single cell is selected returns 1. * * If the user makes a non-contiguous selection, the count for the last contiguous selection within the binding is returned. * * For Word, this property will work only for bindings of {@link Office.BindingType} "table". If the binding is of type "matrix", null is * returned. Also, the call will fail if the table contains merged cells, because the structure of the table must be uniform for this property * to work correctly. */ rowCount: number; /** * The zero-based index of the first column of the selection counting from the leftmost column in the binding. * * If the user makes a non-contiguous selection, the coordinates for the last contiguous selection within the binding are returned. * * For Word, this property will work only for bindings of {@link Office.BindingType} "table". If the binding is of type "matrix", null is * returned. Also, the call will fail if the table contains merged cells, because the structure of the table must be uniform for this property * to work correctly. */ startColumn: number; /** * The zero-based index of the first row of the selection counting from the first row in the binding. * * If the user makes a non-contiguous selection, the coordinates for the last contiguous selection within the binding are returned. * * For Word, this property will work only for bindings of {@link Office.BindingType} "table". If the binding is of type "matrix", null is * returned. Also, the call will fail if the table contains merged cells, because the structure of the table must be uniform for this property * to work correctly. */ startRow: number; /** * Gets an {@link Office.EventType} enumeration value that identifies the kind of event that was raised. */ type: EventType; } /** * Represents the bindings the add-in has within the document. */ interface Bindings { /** * Gets an {@link Office.Document} object that represents the document associated with this set of bindings. */ document: Document; /** * Creates a binding against a named object in the document. * * @remarks * * **Requirement sets**: * * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#matrixbindings | MatrixBindings} * * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#tablebindings | TableBindings} * * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#textbindings | TextBindings} * * For Excel, the itemName parameter can refer to a named range or a table. * * By default, adding a table in Excel assigns the name "Table1" for the first table you add, "Table2" for the second table you add, and so on. * To assign a meaningful name for a table in the Excel UI, use the Table Name property on the Table Tools | Design tab of the ribbon. * * **Note**: In Excel, when specifying a table as a named item, you must fully qualify the name to include the worksheet name in the name of * the table in this format: "Sheet1!Table1" * * For Word, the itemName parameter refers to the Title property of a Rich Text content control. (You can't bind to content controls other * than the Rich Text content control). * * By default, a content control has no Title value assigned. To assign a meaningful name in the Word UI, after inserting a Rich Text content * control from the Controls group on the Developer tab of the ribbon, use the Properties command in the Controls group to display the Content * Control Properties dialog box. Then set the Title property of the content control to the name you want to reference from your code. * * **Note**: In Word, if there are multiple Rich Text content controls with the same Title property value (name), and you try to bind to one * these content controls with this method (by specifying its name as the itemName parameter), the operation will fail. * * @param itemName Name of the bindable object in the document. For Example 'MyExpenses' table in Excel." * @param bindingType The {@link Office.BindingType} for the data. The method returns null if the selected object cannot be coerced into the specified type. * @param options Provides options for configuring the binding that is created. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. * The `value` property of the result is the Binding object that represents the specified named item. */ addFromNamedItemAsync(itemName: string, bindingType: BindingType, options?: AddBindingFromNamedItemOptions, callback?: (result: AsyncResult) => void): void; /** * Creates a binding against a named object in the document. * * @remarks * * {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#matrixbindings | MatrixBindings}, * {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#tablebindings | TableBindings}, * {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#textbindings | TextBindings} * * For Excel, the itemName parameter can refer to a named range or a table. * * By default, adding a table in Excel assigns the name "Table1" for the first table you add, "Table2" for the second table you add, and so on. * To assign a meaningful name for a table in the Excel UI, use the Table Name property on the Table Tools | Design tab of the ribbon. * * **Note**: In Excel, when specifying a table as a named item, you must fully qualify the name to include the worksheet name in the name of * the table in this format: "Sheet1!Table1" * * For Word, the itemName parameter refers to the Title property of a Rich Text content control. (You can't bind to content controls other * than the Rich Text content control). * * By default, a content control has no Title value assigned. To assign a meaningful name in the Word UI, after inserting a Rich Text content * control from the Controls group on the Developer tab of the ribbon, use the Properties command in the Controls group to display the Content * Control Properties dialog box. Then set the Title property of the content control to the name you want to reference from your code. * * **Note**: In Word, if there are multiple Rich Text content controls with the same Title property value (name), and you try to bind to one * these content controls with this method (by specifying its name as the itemName parameter), the operation will fail. * * @param itemName Name of the bindable object in the document. For Example 'MyExpenses' table in Excel." * @param bindingType The {@link Office.BindingType} for the data. The method returns null if the selected object cannot be coerced into the specified type. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. * The `value` property of the result is the Binding object that represents the specified named item. */ addFromNamedItemAsync(itemName: string, bindingType: BindingType, callback?: (result: AsyncResult) => void): void; /** * Create a binding by prompting the user to make a selection on the document. * * @remarks * * **Requirement set**: {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#methods-that-arent-part-of-a-requirement-set | Not in a set} * * Adds a binding object of the specified type to the Bindings collection, which will be identified with the supplied ID. * The method fails if the specified selection cannot be bound. * * @param bindingType Specifies the type of the binding object to create. Required. * Returns null if the selected object cannot be coerced into the specified type. * @param options Provides options for configuring the prompt and identifying the binding that is created. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. * The `value` property of the result is the Binding object that represents the selection specified by the user. */ addFromPromptAsync(bindingType: BindingType, options?: AddBindingFromPromptOptions, callback?: (result: AsyncResult) => void): void; /** * Create a binding by prompting the user to make a selection on the document. * * @remarks * * **Requirement set**: {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#methods-that-arent-part-of-a-requirement-set | Not in a set} * * Adds a binding object of the specified type to the Bindings collection, which will be identified with the supplied ID. * The method fails if the specified selection cannot be bound. * * @param bindingType Specifies the type of the binding object to create. Required. * Returns null if the selected object cannot be coerced into the specified type. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. * The `value` property of the result is the Binding object that represents the selection specified by the user. */ addFromPromptAsync(bindingType: BindingType, callback?: (result: AsyncResult) => void): void; /** * Create a binding based on the user's current selection. * * @remarks * * **Requirement sets**: * * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#matrixbindings | MatrixBindings} * * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#tablebindings | TableBindings} * * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#textbindings | TextBindings} * * Adds the specified type of binding object to the Bindings collection, which will be identified with the supplied id. * * Note In Excel, if you call the addFromSelectionAsync method passing in the Binding.id of an existing binding, the Binding.type of that * binding is used, and its type cannot be changed by specifying a different value for the bindingType parameter. * If you need to use an existing ID and change the bindingType, call the Bindings.releaseByIdAsync method first to release the binding, and * then call the addFromSelectionAsync method to reestablish the binding with a new type. * * @param bindingType Specifies the type of the binding object to create. Required. * Returns null if the selected object cannot be coerced into the specified type. * @param options Provides options for identifying the binding that is created. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. * The `value` property of the result is the Binding object that represents the selection specified by the user. */ addFromSelectionAsync(bindingType: BindingType, options?: AddBindingFromSelectionOptions, callback?: (result: AsyncResult) => void): void; /** * Create a binding based on the user's current selection. * * @remarks * * **Requirement sets**: * * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#matrixbindings | MatrixBindings} * * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#tablebindings | TableBindings} * * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#textbindings | TextBindings} * * Adds the specified type of binding object to the Bindings collection, which will be identified with the supplied id. * * Note In Excel, if you call the addFromSelectionAsync method passing in the Binding.id of an existing binding, the Binding.type of that * binding is used, and its type cannot be changed by specifying a different value for the bindingType parameter. * If you need to use an existing ID and change the bindingType, call the Bindings.releaseByIdAsync method first to release the binding, and * then call the addFromSelectionAsync method to reestablish the binding with a new type. * * @param bindingType Specifies the type of the binding object to create. Required. * Returns null if the selected object cannot be coerced into the specified type. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. * The `value` property of the result is the Binding object that represents the selection specified by the user. */ addFromSelectionAsync(bindingType: BindingType, callback?: (result: AsyncResult) => void): void; /** * Gets all bindings that were previously created. * * @remarks * * **Requirement sets**: * * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#matrixbindings | MatrixBindings} * * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#tablebindings | TableBindings} * * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#textbindings | TextBindings} * * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. * @param callback A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. * The `value` property of the result is an array that contains each binding created for the referenced Bindings object. */ getAllAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Gets all bindings that were previously created. * * @remarks * * **Requirement sets**: * * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#matrixbindings | MatrixBindings} * * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#tablebindings | TableBindings} * * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#textbindings | TextBindings} * * @param callback A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. * The `value` property of the result is an array that contains each binding created for the referenced Bindings object. */ getAllAsync(callback?: (result: AsyncResult) => void): void; /** * Retrieves a binding based on its Name * * @remarks * * **Requirement sets**: * * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#matrixbindings | MatrixBindings} * * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#tablebindings | TableBindings} * * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#textbindings | TextBindings} * * Fails if the specified ID does not exist. * * @param id Specifies the unique name of the binding object. Required. * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. * The `value` property of the result is the Binding object specified by the ID in the call. */ getByIdAsync(id: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Retrieves a binding based on its Name * * @remarks * * **Requirement sets**: * * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#matrixbindings | MatrixBindings} * * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#tablebindings | TableBindings} * * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#textbindings | TextBindings} * * Fails if the specified ID does not exist. * * @param id Specifies the unique name of the binding object. Required. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. * The `value` property of the result is the Binding object specified by the ID in the call. */ getByIdAsync(id: string, callback?: (result: AsyncResult) => void): void; /** * Removes the binding from the document * * @remarks * * **Requirement sets**: * * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#matrixbindings | MatrixBindings} * * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#tablebindings | TableBindings} * * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#textbindings | TextBindings} * * Fails if the specified ID does not exist. * * @param id Specifies the unique name to be used to identify the binding object. Required. * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. */ releaseByIdAsync(id: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Removes the binding from the document * * @remarks * * **Requirement sets**: * * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#matrixbindings | MatrixBindings} * * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#tablebindings | TableBindings} * * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#textbindings | TextBindings} * * Fails if the specified ID does not exist. * * @param id Specifies the unique name to be used to identify the binding object. Required. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. */ releaseByIdAsync(id: string, callback?: (result: AsyncResult) => void): void; } /** * Represents an XML node in a tree in a document. * * @remarks * * **Applications**: Word */ interface CustomXmlNode { /** * Gets the base name of the node without the namespace prefix, if one exists. */ baseName: string; /** * Retrieves the string GUID of the CustomXMLPart. */ namespaceUri: string; /** * Gets the type of the CustomXMLNode. */ nodeType: string; /** * Gets the nodes associated with the XPath expression. * * @remarks * * **Requirement set**: {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#customxmlparts | CustomXmlParts} * * @param xPath The XPath expression that specifies the nodes to get. Required. * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. * The `value` property of the result is an array of CustomXmlNode objects that represent the nodes specified by the XPath expression passed to the `xPath` parameter. */ getNodesAsync(xPath: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Gets the nodes associated with the XPath expression. * * @remarks * * **Requirement set**: {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#customxmlparts | CustomXmlParts} * * @param xPath The XPath expression that specifies the nodes to get. Required. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. * The `value` property of the result is an array of CustomXmlNode objects that represent the nodes specified by the XPath expression passed to the `xPath` parameter. */ getNodesAsync(xPath: string, callback?: (result: AsyncResult) => void): void; /** * Gets the node value. * * @remarks * * **Requirement set**: {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#customxmlparts | CustomXmlParts} * * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. * The `value` property of the result is a string that contains the value of the referenced node. */ getNodeValueAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Gets the node value. * * @remarks * * **Requirement set**: {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#customxmlparts | CustomXmlParts} * * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. * The `value` property of the result is a string that contains the value of the referenced node. */ getNodeValueAsync(callback?: (result: AsyncResult) => void): void; /** * Gets the text of an XML node in a custom XML part. * * @remarks * * **Requirement set**: {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#customxmlparts | CustomXmlParts} * * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. * The `value` property of the result is a string that contains the inner text of the referenced nodes. */ getTextAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Gets the text of an XML node in a custom XML part. * * @remarks * * **Requirement set**: {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#customxmlparts | CustomXmlParts} * * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. * The `value` property of the result is a string that contains the inner text of the referenced nodes. */ getTextAsync(callback?: (result: AsyncResult) => void): void; /** * Gets the node's XML. * * @remarks * * **Requirement set**: {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#customxmlparts | CustomXmlParts} * * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. * The `value` property of the result is a string that contains the XML of the referenced node. */ getXmlAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Gets the node's XML. * * @remarks * * **Requirement set**: {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#customxmlparts | CustomXmlParts} * * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. * The `value` property of the result is a string that contains the XML of the referenced node. */ getXmlAsync(callback?: (result: AsyncResult) => void): void; /** * Sets the node value. * * @remarks * * **Requirement set**: {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#customxmlparts | CustomXmlParts} * * @param value The value to be set on the node * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. */ setNodeValueAsync(value: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Sets the node value. * * @remarks * * **Requirement set**: {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#customxmlparts | CustomXmlParts} * * @param value The value to be set on the node * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. */ setNodeValueAsync(value: string, callback?: (result: AsyncResult) => void): void; /** * Asynchronously sets the text of an XML node in a custom XML part. * * @remarks * * **Requirement set**: {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#customxmlparts | CustomXmlParts} * * @param text Required. The text value of the XML node. * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. */ setTextAsync(text: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Asynchronously sets the text of an XML node in a custom XML part. * * @remarks * * **Requirement set**: {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#customxmlparts | CustomXmlParts} * * @param text Required. The text value of the XML node. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. */ setTextAsync(text: string, callback?: (result: AsyncResult) => void): void; /** * Sets the node XML. * * @remarks * * **Requirement set**: {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#customxmlparts | CustomXmlParts} * * @param xml The XML to be set on the node * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. */ setXmlAsync(xml: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Sets the node XML. * * @remarks * * **Requirement set**: {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#customxmlparts | CustomXmlParts} * * @param xml The XML to be set on the node * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. */ setXmlAsync(xml: string, callback?: (result: AsyncResult) => void): void; } /** * Represents a single CustomXMLPart in an {@link Office.CustomXmlParts} collection. * * @remarks * * **Applications**: Word */ interface CustomXmlPart { /** * True, if the custom XML part is built in; otherwise false. */ builtIn: boolean; /** * Gets the GUID of the CustomXMLPart. */ id: string; /** * Gets the set of namespace prefix mappings ({@link Office.CustomXmlPrefixMappings}) used against the current CustomXmlPart. */ namespaceManager: CustomXmlPrefixMappings; /** * Adds an event handler to the object using the specified event type. * * @remarks * * **Requirement set**: {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#customxmlparts | CustomXmlParts} * * You can add multiple event handlers for the specified eventType as long as the name of each event handler function is unique. * * @param eventType Specifies the type of event to add. For a CustomXmlPart object, the eventType parameter can be specified as * `Office.EventType.NodeDeleted`, `Office.EventType.NodeInserted`, and `Office.EventType.NodeReplaced`. * @param handler The event handler function to add, whose only parameter is of type {@link Office.NodeDeletedEventArgs}, * {@link Office.NodeInsertedEventArgs}, or {@link Office.NodeReplacedEventArgs} * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. */ addHandlerAsync(eventType: Office.EventType, handler: (result: any) => void, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Adds an event handler to the object using the specified event type. * * @remarks * * **Requirement set**: {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#customxmlparts | CustomXmlParts} * * You can add multiple event handlers for the specified eventType as long as the name of each event handler function is unique. * * @param eventType Specifies the type of event to add. For a CustomXmlPart object, the eventType parameter can be specified as * `Office.EventType.NodeDeleted`, `Office.EventType.NodeInserted`, and `Office.EventType.NodeReplaced`. * @param handler The event handler function to add, whose only parameter is of type {@link Office.NodeDeletedEventArgs}, * {@link Office.NodeInsertedEventArgs}, or {@link Office.NodeReplacedEventArgs} * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. */ addHandlerAsync(eventType: Office.EventType, handler: (result: any) => void, callback?: (result: AsyncResult) => void): void; /** * Deletes the Custom XML Part. * * @remarks * * **Requirement set**: {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#customxmlparts | CustomXmlParts} * * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. */ deleteAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Deletes the Custom XML Part. * * @remarks * * **Requirement set**: {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#customxmlparts | CustomXmlParts} * * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. */ deleteAsync(callback?: (result: AsyncResult) => void): void; /** * Asynchronously gets any CustomXmlNodes in this custom XML part which match the specified XPath. * * @remarks * * **Requirement set**: {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#customxmlparts | CustomXmlParts} * * @param xPath An XPath expression that specifies the nodes you want returned. Required. * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. * The `value` property of the result is an array of CustomXmlNode objects that represent the nodes specified by the XPath expression passed to the xPath parameter. */ getNodesAsync(xPath: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Asynchronously gets any CustomXmlNodes in this custom XML part which match the specified XPath. * * @remarks * * **Requirement set**: {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#customxmlparts | CustomXmlParts} * * @param xPath An XPath expression that specifies the nodes you want returned. Required. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. * The `value` property of the result is an array of CustomXmlNode objects that represent the nodes specified by the XPath expression passed to the xPath parameter. */ getNodesAsync(xPath: string, callback?: (result: AsyncResult) => void): void; /** * Asynchronously gets the XML inside this custom XML part. * * @remarks * * **Requirement set**: {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#customxmlparts | CustomXmlParts} * * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. * The `value` property of the result is a string that contains the XML of the referenced CustomXmlPart object. */ getXmlAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Asynchronously gets the XML inside this custom XML part. * * @remarks * * **Requirement set**: {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#customxmlparts | CustomXmlParts} * * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. * The `value` property of the result is a string that contains the XML of the referenced CustomXmlPart object. */ getXmlAsync(callback?: (result: AsyncResult) => void): void; /** * Removes an event handler for the specified event type. * * @remarks * * **Requirement set**: {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#customxmlparts | CustomXmlParts} * * @param eventType Specifies the type of event to remove. For a CustomXmlPart object, the eventType parameter can be specified as * `Office.EventType.NodeDeleted`, `Office.EventType.NodeInserted`, and `Office.EventType.NodeReplaced`. * @param handler The name of the handler to remove. * @param options Provides options to determine which event handler or handlers are removed. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. */ removeHandlerAsync(eventType: Office.EventType, handler?: (result: any) => void, options?: RemoveHandlerOptions, callback?: (result: AsyncResult) => void): void; /** * Removes an event handler for the specified event type. * * @remarks * * **Requirement set**: {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#customxmlparts | CustomXmlParts} * * @param eventType Specifies the type of event to remove. For a CustomXmlPart object, the eventType parameter can be specified as * `Office.EventType.NodeDeleted`, `Office.EventType.NodeInserted`, and `Office.EventType.NodeReplaced`. * @param handler The name of the handler to remove. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. */ removeHandlerAsync(eventType: Office.EventType, handler?: (result: any) => void, callback?: (result: AsyncResult) => void): void; } /** * Provides information about the deleted node that raised the nodeDeleted event. */ interface NodeDeletedEventArgs { /** * Gets whether the node was deleted as part of an Undo/Redo action by the user. */ isUndoRedo: boolean; /** * Gets the former next sibling of the node that was just deleted from the {@link Office.CustomXmlPart} object. */ oldNextSibling: CustomXmlNode; /** * Gets the node which was just deleted from the {@link Office.CustomXmlPart} object. * * Note that this node may have children, if a subtree is being removed from the document. Also, this node will be a "disconnected" node in * that you can query down from the node, but you cannot query up the tree - the node appears to exist alone. */ oldNode: CustomXmlNode; } /** * Provides information about the inserted node that raised the nodeInserted event. */ interface NodeInsertedEventArgs { /** * Gets whether the node was inserted as part of an Undo/Redo action by the user. */ isUndoRedo: boolean; /** * Gets the node that was just added to the CustomXMLPart object. * * Note that this node may have children, if a subtree was just added to the document. */ newNode: CustomXmlNode; } /** * Provides information about the replaced node that raised the nodeReplaced event. */ interface NodeReplacedEventArgs { /** * Gets whether the replaced node was inserted as part of an undo or redo operation by the user. */ isUndoRedo: boolean; /** * Gets the node that was just added to the CustomXMLPart object. * * Note that this node may have children, if a subtree was just added to the document. */ newNode: CustomXmlNode; /** * Gets the node which was just deleted (replaced) from the CustomXmlPart object. * * Note that this node may have children, if a subtree is being removed from the document. Also, this node will be a "disconnected" node in * that you can query down from the node, but you cannot query up the tree - the node appears to exist alone. */ oldNode: CustomXmlNode; } /** * Represents a collection of CustomXmlPart objects. * * @remarks * * **Applications**: Word */ interface CustomXmlParts { /** * Asynchronously adds a new custom XML part to a file. * * @remarks * * **Requirement set**: {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#customxmlparts | CustomXmlParts} * * @param xml The XML to add to the newly created custom XML part. * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. * The `value` property of the result is the newly created CustomXmlPart object. */ addAsync(xml: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Asynchronously adds a new custom XML part to a file. * * @remarks * * **Requirement set**: {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#customxmlparts | CustomXmlParts} * * @param xml The XML to add to the newly created custom XML part. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. * The `value` property of the result is the newly created CustomXmlPart object. */ addAsync(xml: string, callback?: (result: AsyncResult) => void): void; /** * Asynchronously gets the specified custom XML part by its ID. * * @remarks * * **Requirement set**: {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#customxmlparts | CustomXmlParts} * * @param id The GUID of the custom XML part, including opening and closing braces. * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. * The `value` property of the result is a CustomXmlPart object that represents the specified custom XML part. * If there is no custom XML part with the specified ID, the method returns null. */ getByIdAsync(id: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Asynchronously gets the specified custom XML part by its ID. * * @remarks * * **Requirement set**: {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#customxmlparts | CustomXmlParts} * * @param id The GUID of the custom XML part, including opening and closing braces. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. * The `value` property of the result is a CustomXmlPart object that represents the specified custom XML part. * If there is no custom XML part with the specified ID, the method returns null. */ getByIdAsync(id: string, callback?: (result: AsyncResult) => void): void; /** * Asynchronously gets the specified custom XML parts by its namespace. * * @remarks * * **Requirement set**: {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#customxmlparts | CustomXmlParts} * * @param ns The namespace URI. * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. * The `value` property of the result is an array of CustomXmlPart objects that match the specified namespace. */ getByNamespaceAsync(ns: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Asynchronously gets the specified custom XML parts by its namespace. * * @remarks * * **Requirement set**: {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#customxmlparts | CustomXmlParts} * * @param ns The namespace URI. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. * The `value` property of the result is an array of CustomXmlPart objects that match the specified namespace. */ getByNamespaceAsync(ns: string, callback?: (result: AsyncResult) => void): void; } /** * Represents a collection of CustomXmlPart objects. * * @remarks * * **Applications**: Word */ interface CustomXmlPrefixMappings { /** * Asynchronously adds a prefix to namespace mapping to use when querying an item. * * @remarks * * **Requirement set**: {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#customxmlparts | CustomXmlParts} * * If no namespace is assigned to the requested prefix, the method returns an empty string (""). * * @param prefix Specifies the prefix to add to the prefix mapping list. Required. * @param ns Specifies the namespace URI to assign to the newly added prefix. Required. * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. */ addNamespaceAsync(prefix: string, ns: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Asynchronously adds a prefix to namespace mapping to use when querying an item. * * @remarks * * **Requirement set**: {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#customxmlparts | CustomXmlParts} * * If no namespace is assigned to the requested prefix, the method returns an empty string (""). * * @param prefix Specifies the prefix to add to the prefix mapping list. Required. * @param ns Specifies the namespace URI to assign to the newly added prefix. Required. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. */ addNamespaceAsync(prefix: string, ns: string, callback?: (result: AsyncResult) => void): void; /** * Asynchronously gets the namespace mapped to the specified prefix. * * @remarks * * **Requirement set**: {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#customxmlparts | CustomXmlParts} * * If the prefix already exists in the namespace manager, this method will overwrite the mapping of that prefix except when the prefix is one * added or used by the data store internally, in which case it will return an error. * * @param prefix TSpecifies the prefix to get the namespace for. Required. * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. * The `value` property of the result is a string that contains the namespace mapped to the specified prefix. */ getNamespaceAsync(prefix: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Asynchronously gets the namespace mapped to the specified prefix. * * @remarks * * **Requirement set**: {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#customxmlparts | CustomXmlParts} * * If the prefix already exists in the namespace manager, this method will overwrite the mapping of that prefix except when the prefix is one * added or used by the data store internally, in which case it will return an error. * * @param prefix TSpecifies the prefix to get the namespace for. Required. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. * The `value` property of the result is a string that contains the namespace mapped to the specified prefix. */ getNamespaceAsync(prefix: string, callback?: (result: AsyncResult) => void): void; /** * Asynchronously gets the prefix for the specified namespace. * * @remarks * * **Requirement set**: {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#customxmlparts | CustomXmlParts} * * If no prefix is assigned to the requested namespace, the method returns an empty string (""). If there are multiple prefixes specified in * the namespace manager, the method returns the first prefix that matches the supplied namespace. * * @param ns Specifies the namespace to get the prefix for. Required. * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. * The `value` property of the result is a string that contains the prefix of the specified namespace. */ getPrefixAsync(ns: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Asynchronously gets the prefix for the specified namespace. * * @remarks * * **Requirement set**: {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#customxmlparts | CustomXmlParts} * * If no prefix is assigned to the requested namespace, the method returns an empty string (""). If there are multiple prefixes specified in * the namespace manager, the method returns the first prefix that matches the supplied namespace. * * @param ns Specifies the namespace to get the prefix for. Required. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. * The `value` property of the result is a string that contains the prefix of the specified namespace. */ getPrefixAsync(ns: string, callback?: (result: AsyncResult) => void): void; } /** * An abstract class that represents the document the add-in is interacting with. * * @remarks * * **Applications**: Excel, PowerPoint, Project, Word */ interface Document { /** * Gets an object that provides access to the bindings defined in the document. * * @remarks * * You don't instantiate the Document object directly in your script. To call members of the Document object to interact with the current * document or worksheet, use `Office.context.document` in your script. */ bindings: Bindings; /** * Gets an object that represents the custom XML parts in the document. */ customXmlParts: CustomXmlParts; /** * Gets the mode the document is in. */ mode: DocumentMode; /** * Gets an object that represents the saved custom settings of the content or task pane add-in for the current document. */ settings: Settings; /** * Gets the URL of the document that the Office application currently has open. Returns null if the URL is unavailable. */ url: string; /** * Adds an event handler for a Document object event. * * @remarks * * **Requirement set**: {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#documentevents | DocumentEvents} * * You can add multiple event handlers for the specified eventType as long as the name of each event handler function is unique. * * @param eventType For a Document object event, the eventType parameter can be specified as `Office.EventType.Document.SelectionChanged` or * `Office.EventType.Document.ActiveViewChanged`, or the corresponding text value of this enumeration. * @param handler The event handler function to add, whose only parameter is of type {@link Office.DocumentSelectionChangedEventArgs}. Required. * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. */ addHandlerAsync(eventType: Office.EventType, handler: any, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Adds an event handler for a Document object event. * * @remarks * * **Requirement set**: {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#documentevents | DocumentEvents} * * You can add multiple event handlers for the specified eventType as long as the name of each event handler function is unique. * * @param eventType For a Document object event, the eventType parameter can be specified as `Office.EventType.Document.SelectionChanged` or * `Office.EventType.Document.ActiveViewChanged`, or the corresponding text value of this enumeration. * @param handler The event handler function to add, whose only parameter is of type {@link Office.DocumentSelectionChangedEventArgs}. Required. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. */ addHandlerAsync(eventType: Office.EventType, handler: any, callback?: (result: AsyncResult) => void): void; /** * Returns the state of the current view of the presentation (edit or read). * * @remarks * * **Requirement set**: {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#activeview | ActiveView} * * Can trigger an event when the view changes. * * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. * The `value` property of the result is the state of the presentation's current view. * The value returned can be either "edit" or "read". "edit" corresponds to any of the views in which you can edit slides: * Normal, Slide Sorter, or Outline View. "read" corresponds to either Slide Show or Reading View. */ getActiveViewAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult<"edit" | "read">) => void): void; /** * Returns the state of the current view of the presentation (edit or read). * * @remarks * * **Requirement set**: {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#activeview | ActiveView} * * Can trigger an event when the view changes. * * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. * The `value` property of the result is the state of the presentation's current view. * The value returned can be either "edit" or "read". "edit" corresponds to any of the views in which you can edit slides: * Normal, Slide Sorter, or Outline View. "read" corresponds to either Slide Show or Reading View. */ getActiveViewAsync(callback?: (result: AsyncResult<"edit" | "read">) => void): void; /** * Returns the entire document file in slices of up to 4194304 bytes (4 MB). For add-ins on iPad, file slice is supported up to 65536 (64 KB). * Note that specifying file slice size of above permitted limit will result in an "Internal Error" failure. * * @remarks * * **Requirement sets**: * * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#compressedfile | CompressedFile} (when using `Office.FileType.Compressed`) * * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#file | File} * * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#textfile | TextFile} (when using `Office.FileType.Text`) * * For add-ins running in Office applications other than Office on iPad, the `getFileAsync` method supports getting files in slices of up * to 4194304 bytes (4 MB). For add-ins running in Office apps on iPad, the `getFileAsync` method supports getting files in slices of up to * 65536 (64 KB). * * The `fileType` parameter can be specified by using the {@link Office.FileType} enumeration or text values. But the possible values vary with * the application. * * *Supported FileTypes, by platform* * * * * * *
Office on Windows Office on the web Office on iPad Office on Mac
Excel Compressed, Pdf, TextCompressed, Pdf Compressed, Pdf, Text
PowerPoint Compressed, Pdf Compressed, Pdf Compressed, PdfCompressed, Pdf
Word Compressed, Pdf, TextCompressed, Pdf, TextCompressed, PdfCompressed, Pdf, Text
* * @param fileType The format in which the file will be returned * @param options Provides options for setting the size of slices that the document will be divided into. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. * The `value` property of the result is the File object. */ getFileAsync(fileType: FileType, options?: GetFileOptions, callback?: (result: AsyncResult) => void): void; /** * Returns the entire document file in slices of up to 4194304 bytes (4 MB). For add-ins on iPad, file slice is supported up to 65536 (64 KB). * Note that specifying file slice size of above permitted limit will result in an "Internal Error" failure. * * @remarks * * **Requirement sets**: * * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#compressedfile | CompressedFile} (when using `Office.FileType.Compressed`) * * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#file | File} * * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#textfile | TextFile} (when using `Office.FileType.Text`) * * For add-ins running in Office applications other than Office on iPad, the `getFileAsync` method supports getting files in slices of up * to 4194304 bytes (4 MB). For add-ins running in Office on iPad apps, the `getFileAsync` method supports getting files in slices of up to * 65536 (64 KB). * * The `fileType` parameter can be specified by using the {@link Office.FileType} enumeration or text values. But the possible values vary with * the application. * * *Supported FileTypes, by platform* * * * * * *
Office on Windows Office on the web Office on iPad Office on Mac
Excel Compressed, Pdf, TextCompressed, Pdf Compressed, Pdf, Text
PowerPoint Compressed, Pdf Compressed, Pdf Compressed, PdfCompressed, Pdf
Word Compressed, Pdf, TextCompressed, Pdf, TextCompressed, PdfCompressed, Pdf, Text
* * @param fileType The format in which the file will be returned * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. * The `value` property of the result is the File object. */ getFileAsync(fileType: FileType, callback?: (result: AsyncResult) => void): void; /** * Gets file properties of the current document. * * @remarks * * **Requirement sets**: {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#methods-that-arent-part-of-a-requirement-set | Not in a set} * * You get the file's URL with the url property `asyncResult.value.url`. * * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. * @param callback A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. * The `value` property of the result is the file's properties (with the URL found at `asyncResult.value.url`). */ getFilePropertiesAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Gets file properties of the current document. * * @remarks * * **Requirement sets**: {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#methods-that-arent-part-of-a-requirement-set | Not in a set} * * You get the file's URL with the url property `asyncResult.value.url`. * * @param callback A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. * The `value` property of the result is the file's properties (with the URL found at `asyncResult.value.url`). */ getFilePropertiesAsync(callback?: (result: AsyncResult) => void): void; /** * Reads the data contained in the current selection in the document. * * @remarks * * **Requirement sets**: * * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#htmlcoercion | HtmlCoercion} (when using `Office.CoercionType.Html`) * * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#matrixcoercion | MatrixCoercion} (when using `Office.CoercionType.Matrix`) * * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#ooxmlcoercion | OoxmlCoercion} (when using `Office.CoercionType.Ooxml`) * * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#selection | Selection} * * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#tablecoercion | TableCoercion} (when using `Office.CoercionType.Table`) * * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#textcoercion | TextCoercion} (when using `Office.CoercionType.Text`) * * In the callback function that is passed to the getSelectedDataAsync method, you can use the properties of the AsyncResult object to return * the following information. * * * * * * * * * * * * * * * * * * * * * * *
PropertyUse
AsyncResult.valueAlways returns undefined because there is no object or data to retrieve
AsyncResult.statusDetermine the success or failure of the operation
AsyncResult.errorAccess an Error object that provides error information if the operation failed
AsyncResult.asyncContextDefine an item of any type that is returned in the AsyncResult object without being altered
* * The possible values for the {@link Office.CoercionType} parameter vary by the Office application. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
CoercionTypeSupported applications
Office.CoercionType.Html- Word
Office.CoercionType.Matrix (array of arrays)- Excel
- Word
Office.CoercionType.Ooxml (Office Open XML)- Word
Office.CoercionType.SlideRange- PowerPoint
Office.CoercionType.Table (TableData object)- Excel
- Word
Office.CoercionType.Text (string)- Excel
- PowerPoint
- Project
- Word
Office.CoercionType.XmlSvg- Excel on Windows and on Mac
- PowerPoint on Windows, on Mac, and on the web
* * @param coercionType The type of data structure to return. See the Remarks section for each application's supported coercion types. * * @param options Provides options for customizing what data is returned and how it is formatted. * * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. * The `value` property of the result is the data in the current selection. * This is returned in the data structure or format you specified with the coercionType parameter. * (See Remarks for more information about data coercion.) */ getSelectedDataAsync(coercionType: Office.CoercionType, options?: GetSelectedDataOptions, callback?: (result: AsyncResult) => void): void; /** * Reads the data contained in the current selection in the document. * * @remarks * * **Requirement sets**: * * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#htmlcoercion | HtmlCoercion} (when using `Office.CoercionType.Html`) * * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#matrixcoercion | MatrixCoercion} (when using `Office.CoercionType.Matrix`) * * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#ooxmlcoercion | OoxmlCoercion} (when using `Office.CoercionType.Ooxml`) * * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#selection | Selection} * * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#tablecoercion | TableCoercion} (when using `Office.CoercionType.Table`) * * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#textcoercion | TextCoercion} (when using `Office.CoercionType.Text`) * * In the callback function that is passed to the getSelectedDataAsync method, you can use the properties of the AsyncResult object to return * the following information. * * * * * * * * * * * * * * * * * * * * * * *
PropertyUse
AsyncResult.valueAlways returns undefined because there is no object or data to retrieve
AsyncResult.statusDetermine the success or failure of the operation
AsyncResult.errorAccess an Error object that provides error information if the operation failed
AsyncResult.asyncContextDefine an item of any type that is returned in the AsyncResult object without being altered
* * The possible values for the {@link Office.CoercionType} parameter vary by the Office application. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
CoercionTypeSupported applications
Office.CoercionType.Html- Word
Office.CoercionType.Matrix (array of arrays)- Excel
- Word
Office.CoercionType.Ooxml (Office Open XML)- Word
Office.CoercionType.SlideRange- PowerPoint
Office.CoercionType.Table (TableData object)- Excel
- Word
Office.CoercionType.Text (string)- Excel
- PowerPoint
- Project
- Word
Office.CoercionType.XmlSvg- Excel on Windows and on Mac
- PowerPoint on Windows, on Mac, and on the web
* * @param coercionType The type of data structure to return. See the Remarks section for each application's supported coercion types. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. * The `value` property of the result is the data in the current selection. * This is returned in the data structure or format you specified with the coercionType parameter. * (See Remarks for more information about data coercion.) */ getSelectedDataAsync(coercionType: Office.CoercionType, callback?: (result: AsyncResult) => void): void; /** * Goes to the specified object or location in the document. * * @remarks * * **Requirement set**: {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#methods-that-arent-part-of-a-requirement-set | Not in a set} * * PowerPoint doesn't support the goToByIdAsync method in Master Views. * * The behavior caused by the selectionMode option varies by Office application: * * In Excel: `Office.SelectionMode.Selected` selects all content in the binding, or named item. Office.SelectionMode.None for text bindings, * selects the cell; for matrix bindings, table bindings, and named items, selects the first data cell (not first cell in header row for tables). * * In PowerPoint: `Office.SelectionMode.Selected` selects the slide title or first textbox on the slide. * `Office.SelectionMode.None` doesn't select anything. * * In Word: `Office.SelectionMode.Selected` selects all content in the binding. Office.SelectionMode.None for text bindings, moves the cursor * to the beginning of the text; for matrix bindings and table bindings, selects the first data cell (not first cell in header row for tables). * * @param id The identifier of the object or location to go to. * @param goToType The type of the location to go to. * @param options Provides options for whether to select the location that is navigated to. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. * The `value` property of the result is the current view. */ goToByIdAsync(id: string | number, goToType: GoToType, options?: GoToByIdOptions, callback?: (result: AsyncResult) => void): void; /** * Goes to the specified object or location in the document. * * @remarks * * **Requirement set**: {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#methods-that-arent-part-of-a-requirement-set | Not in a set} * * PowerPoint doesn't support the goToByIdAsync method in Master Views. * * The behavior caused by the selectionMode option varies by Office application: * * In Excel: `Office.SelectionMode.Selected` selects all content in the binding, or named item. Office.SelectionMode.None for text bindings, * selects the cell; for matrix bindings, table bindings, and named items, selects the first data cell (not first cell in header row for tables). * * In PowerPoint: `Office.SelectionMode.Selected` selects the slide title or first textbox on the slide. * `Office.SelectionMode.None` doesn't select anything. * * In Word: `Office.SelectionMode.Selected` selects all content in the binding. Office.SelectionMode.None for text bindings, moves the cursor * to the beginning of the text; for matrix bindings and table bindings, selects the first data cell (not first cell in header row for tables). * * @param id The identifier of the object or location to go to. * @param goToType The type of the location to go to. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. * The `value` property of the result is the current view. */ goToByIdAsync(id: string | number, goToType: GoToType, callback?: (result: AsyncResult) => void): void; /** * Removes an event handler for the specified event type. * * @remarks * * **Requirement set**: {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#documentevents | DocumentEvents} * * @param eventType The event type. For document can be 'Document.SelectionChanged' or 'Document.ActiveViewChanged'. * @param options Provides options to determine which event handler or handlers are removed. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. */ removeHandlerAsync(eventType: Office.EventType, options?: RemoveHandlerOptions, callback?: (result: AsyncResult) => void): void; /** * Removes an event handler for the specified event type. * * @remarks * * **Requirement set**: {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#documentevents | DocumentEvents} * * @param eventType The event type. For document can be 'Document.SelectionChanged' or 'Document.ActiveViewChanged'. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. */ removeHandlerAsync(eventType: Office.EventType, callback?: (result: AsyncResult) => void): void; /** * Writes the specified data into the current selection. * * @remarks * * **Requirement sets**: * * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#htmlcoercion | HtmlCoercion}, (when using `Office.CoercionType.Html`) * * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/image-coercion-requirement-sets | ImageCoercion 1.1} (when using `Office.CoercionType.Image`) * * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#matrixcoercion | MatrixCoercion} (when using `Office.CoercionType.Matrix`) * * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#ooxmlcoercion | OoxmlCoercion} (when using `Office.CoercionType.Ooxml`) * * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#selection | Selection} * * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#tablecoercion | TableCoercion} (when using `Office.CoercionType.Table`) * * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#textcoercion | TextCoercion} (when using `Office.CoercionType.Text`) * * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/image-coercion-requirement-sets#imagecoercion-12 | ImageCoercion 1.2} (when using `Office.CoercionType.XmlSvg`) * * **Application-specific behaviors** * * The following application-specific actions apply when writing data to a selection. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
WordIf there is no selection and the insertion point is at a valid location, the specified data is inserted at the insertion pointIf data is a string, the specified text is inserted.
If data is an array of arrays ("matrix") or a TableData object, a new Word table is inserted.
If data is HTML, the specified HTML is inserted. (**Important**: If any of the HTML you insert is invalid, Word won't raise an error. Word will insert as much of the HTML as it can and omits any invalid data).
If data is Office Open XML, the specified XML is inserted.
If data is a base64 encoded image stream, the specified image is inserted.
If there is a selectionIt will be replaced with the specified data following the same rules as above.
Insert imagesInserted images are placed inline. The imageLeft and imageTop parameters are ignored. The image aspect ratio is always locked. If only one of the imageWidth and imageHeight parameter is given, the other value will be automatically scaled to keep the original aspect ratio.
ExcelIf a single cell is selectedIf data is a string, the specified text is inserted as the value of the current cell.
If data is an array of arrays ("matrix"), the specified set of rows and columns are inserted, if no other data in surrounding cells will be overwritten.
If data is a TableData object, a new Excel table with the specified set of rows and headers is inserted, if no other data in surrounding cells will be overwritten.
If multiple cells are selectedIf the shape does not match the shape of data, an error is returned.
If the shape of the selection exactly matches the shape of data, the values of the selected cells are updated based on the values in data.
Insert imagesInserted images are floating. The position imageLeft and imageTop parameters are relative to currently selected cells. Negative imageLeft and imageTop values are allowed and possibly readjusted by Excel to position the image inside a worksheet. Image aspect ratio is locked unless both imageWidth and imageHeight parameters are provided. If only one of the imageWidth and imageHeight parameter is given, the other value will be automatically scaled to keep the original aspect ratio.
All other casesAn error is returned.
Excel on the webIn addition to the behaviors described for Excel above, these limits apply when writing data in Excel on the webThe total number of cells you can write to a worksheet with the data parameter can't exceed 20,000 in a single call to this method.
The number of formatting groups passed to the cellFormat parameter can't exceed 100. A single formatting group consists of a set of formatting applied to a specified range of cells.
PowerPointInsert imageInserted images are floating. The position imageLeft and imageTop parameters are optional but if provided, both should be present. If a single value is provided, it will be ignored. Negative imageLeft and imageTop values are allowed and can position an image outside of a slide. If no optional parameter is given and slide has a placeholder, the image will replace the placeholder in the slide. Image aspect ratio will be locked unless both imageWidth and imageHeight parameters are provided. If only one of the imageWidth and imageHeight parameter is given, the other value will be automatically scaled to keep the original aspect ratio.
* * **Applications** * * The possible values for the {@link Office.CoercionType} parameter vary by the Office application. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
CoercionTypeSupported applications
Office.CoercionType.Html- Word
Office.CoercionType.Matrix (array of arrays)- Excel
- Word
Office.CoercionType.Ooxml (Office Open XML)- Word
Office.CoercionType.SlideRange- PowerPoint on the web and on Windows
Office.CoercionType.Table (TableData object)- Excel
- Word
Office.CoercionType.Text (string)- Excel
- PowerPoint
- Project
- Word
Office.CoercionType.XmlSvg- Excel on Windows and on Mac
- PowerPoint on Windows, on Mac, and on the web
- Word on Windows and on Mac
* * @param data The data to be set. Either a string or {@link Office.CoercionType} value, 2d array or TableData object. * * If the value passed for `data` is: * * - A string: Plain text or anything that can be coerced to a string will be inserted. * In Excel, you can also specify data as a valid formula to add that formula to the selected cell. For example, setting data to "=SUM(A1:A5)" * will total the values in the specified range. However, when you set a formula on the bound cell, after doing so, you can't read the added * formula (or any pre-existing formula) from the bound cell. If you call the Document.getSelectedDataAsync method on the selected cell to * read its data, the method can return only the data displayed in the cell (the formula's result). * * - An array of arrays ("matrix"): Tabular data without headers will be inserted. For example, to write data to three rows in two columns, * you can pass an array like this: [["R1C1", "R1C2"], ["R2C1", "R2C2"], ["R3C1", "R3C2"]]. To write a single column of three rows, pass an * array like this: [["R1C1"], ["R2C1"], ["R3C1"]] * * In Excel, you can also specify data as an array of arrays that contains valid formulas to add them to the selected cells. For example if no * other data will be overwritten, setting data to [["=SUM(A1:A5)","=AVERAGE(A1:A5)"]] will add those two formulas to the selection. Just as * when setting a formula on a single cell as "text", you can't read the added formulas (or any pre-existing formulas) after they have been * set - you can only read the formulas' results. * * - A TableData object: A table with headers will be inserted. * In Excel, if you specify formulas in the TableData object you pass for the data parameter, you might not get the results you expect due to * the "calculated columns" feature of Excel, which automatically duplicates formulas within a column. To work around this when you want to * write `data` that contains formulas to a selected table, try specifying the data as an array of arrays (instead of a TableData object), and * specify the coercionType as Microsoft.Office.Matrix or "matrix". However, this technique will block the "calculated columns" feature only * when one of the following conditions is met: (1) you are writing to all the cells of the column, or (2) there are already at least two * different formulas in the column. * * @param options Provides options for how to insert data to the selection. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. * The AsyncResult.value property always returns `undefined` because there is no object or data to retrieve. */ setSelectedDataAsync(data: string | TableData | any[][], options?: SetSelectedDataOptions, callback?: (result: AsyncResult) => void): void; /** * Writes the specified data into the current selection. * * @remarks * * **Requirement sets**: * * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#htmlcoercion | HtmlCoercion}, (when using `Office.CoercionType.Html`) * * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/image-coercion-requirement-sets | ImageCoercion} (when using `Office.CoercionType.Image`) * * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#matrixcoercion | MatrixCoercion} (when using `Office.CoercionType.Matrix`) * * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#ooxmlcoercion | OoxmlCoercion} (when using `Office.CoercionType.Ooxml`) * * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#selection | Selection} * * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#tablecoercion | TableCoercion} (when using `Office.CoercionType.Table`) * * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#textcoercion | TextCoercion} (when using `Office.CoercionType.Text`) * * - {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/image-coercion-requirement-sets#imagecoercion-12 | ImageCoercion 1.2} (when using `Office.CoercionType.XmlSvg`) * * **Application-specific behaviors** * * The following application-specific actions apply when writing data to a selection. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
WordIf there is no selection and the insertion point is at a valid location, the specified `data` is inserted at the insertion pointIf data is a string, the specified text is inserted.
If data is an array of arrays ("matrix") or a TableData object, a new Word table is inserted.
If data is HTML, the specified HTML is inserted. (**Important**: If any of the HTML you insert is invalid, Word won't raise an error. Word will insert as much of the HTML as it can and omits any invalid data).
If data is Office Open XML, the specified XML is inserted.
If data is a base64 encoded image stream, the specified image is inserted.
If there is a selectionIt will be replaced with the specified data following the same rules as above.
Insert imagesInserted images are placed inline. The imageLeft and imageTop parameters are ignored. The image aspect ratio is always locked. If only one of the imageWidth and imageHeight parameter is given, the other value will be automatically scaled to keep the original aspect ratio.
ExcelIf a single cell is selectedIf data is a string, the specified text is inserted as the value of the current cell.
If data is an array of arrays ("matrix"), the specified set of rows and columns are inserted, if no other data in surrounding cells will be overwritten.
If data is a TableData object, a new Excel table with the specified set of rows and headers is inserted, if no other data in surrounding cells will be overwritten.
If multiple cells are selectedIf the shape does not match the shape of data, an error is returned.
If the shape of the selection exactly matches the shape of data, the values of the selected cells are updated based on the values in data.
Insert imagesInserted images are floating. The position imageLeft and imageTop parameters are relative to currently selected cells. Negative imageLeft and imageTop values are allowed and possibly readjusted by Excel to position the image inside a worksheet. Image aspect ratio is locked unless both imageWidth and imageHeight parameters are provided. If only one of the imageWidth and imageHeight parameter is given, the other value will be automatically scaled to keep the original aspect ratio.
All other casesAn error is returned.
Excel on the webIn addition to the behaviors described for Excel above, these limits apply when writing data in Excel on the webThe total number of cells you can write to a worksheet with the data parameter can't exceed 20,000 in a single call to this method.
The number of formatting groups passed to the cellFormat parameter can't exceed 100. A single formatting group consists of a set of formatting applied to a specified range of cells.
PowerPointInsert imageInserted images are floating. The position imageLeft and imageTop parameters are optional but if provided, both should be present. If a single value is provided, it will be ignored. Negative imageLeft and imageTop values are allowed and can position an image outside of a slide. If no optional parameter is given and slide has a placeholder, the image will replace the placeholder in the slide. Image aspect ratio will be locked unless both imageWidth and imageHeight parameters are provided. If only one of the imageWidth and imageHeight parameter is given, the other value will be automatically scaled to keep the original aspect ratio.
* * **Applications** * * The possible values for the {@link Office.CoercionType} parameter vary by the Office application. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
CoercionTypeSupported applications
Office.CoercionType.Html- Word
Office.CoercionType.Matrix (array of arrays)- Excel
- Word
Office.CoercionType.Ooxml (Office Open XML)- Word
Office.CoercionType.SlideRange- PowerPoint on the web and on Windows
Office.CoercionType.Table (TableData object)- Excel
- Word
Office.CoercionType.Text (string)- Excel
- PowerPoint
- Project
- Word
Office.CoercionType.XmlSvg- Excel on Windows and on Mac
- PowerPoint on Windows, on Mac, and on the web
- Word on Windows and on Mac
* * @param data The data to be set. Either a string or {@link Office.CoercionType} value, 2d array or TableData object. * * If the value passed for `data` is: * * - A string: Plain text or anything that can be coerced to a string will be inserted. * In Excel, you can also specify data as a valid formula to add that formula to the selected cell. For example, setting data to "=SUM(A1:A5)" * will total the values in the specified range. However, when you set a formula on the bound cell, after doing so, you can't read the added * formula (or any pre-existing formula) from the bound cell. If you call the Document.getSelectedDataAsync method on the selected cell to * read its data, the method can return only the data displayed in the cell (the formula's result). * * - An array of arrays ("matrix"): Tabular data without headers will be inserted. For example, to write data to three rows in two columns, * you can pass an array like this: [["R1C1", "R1C2"], ["R2C1", "R2C2"], ["R3C1", "R3C2"]]. To write a single column of three rows, pass an * array like this: [["R1C1"], ["R2C1"], ["R3C1"]] * * In Excel, you can also specify data as an array of arrays that contains valid formulas to add them to the selected cells. For example if no * other data will be overwritten, setting data to [["=SUM(A1:A5)","=AVERAGE(A1:A5)"]] will add those two formulas to the selection. Just as * when setting a formula on a single cell as "text", you can't read the added formulas (or any pre-existing formulas) after they have been * set - you can only read the formulas' results. * * - A TableData object: A table with headers will be inserted. * In Excel, if you specify formulas in the TableData object you pass for the data parameter, you might not get the results you expect due to * the "calculated columns" feature of Excel, which automatically duplicates formulas within a column. To work around this when you want to * write `data` that contains formulas to a selected table, try specifying the data as an array of arrays (instead of a TableData object), and * specify the coercionType as Microsoft.Office.Matrix or "matrix". However, this technique will block the "calculated columns" feature only * when one of the following conditions is met: (1) you are writing to all the cells of the column, or (2) there are already at least two * different formulas in the column. * * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. * The AsyncResult.value property always returns `undefined` because there is no object or data to retrieve. */ setSelectedDataAsync(data: string | TableData | any[][], callback?: (result: AsyncResult) => void): void; /** * Project documents only. Get Project field (Ex. ProjectWebAccessURL). * @param fieldId Project level fields. * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. * The `value` property of the result contains the `fieldValue` property, which represents the value of the specified field. */ getProjectFieldAsync(fieldId: number, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Project documents only. Get Project field (Ex. ProjectWebAccessURL). * @param fieldId Project level fields. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. * The `value` property of the result contains the `fieldValue` property, which represents the value of the specified field. * */ getProjectFieldAsync(fieldId: number, callback?: (result: AsyncResult) => void): void; /** * Project documents only. Get resource field for provided resource Id. (Ex.ResourceName) * @param resourceId Either a string or value of the Resource Id. * @param fieldId Resource Fields. * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. * The `value` property of the result is the GUID of the resource as a string. * */ getResourceFieldAsync(resourceId: string, fieldId: number, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Project documents only. Get resource field for provided resource Id. (Ex.ResourceName) * @param resourceId Either a string or value of the Resource Id. * @param fieldId Resource Fields. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. * The `value` property of the result is the GUID of the resource as a string. * */ getResourceFieldAsync(resourceId: string, fieldId: number, callback?: (result: AsyncResult) => void): void; /** * Project documents only. Get the current selected Resource's Id. * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. * The `value` property of the result is the GUID of the resource as a string. * */ getSelectedResourceAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Project documents only. Get the current selected Resource's Id. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. * The `value` property of the result is the GUID of the resource as a string. * */ getSelectedResourceAsync(callback?: (result: AsyncResult) => void): void; /** * Project documents only. Get the current selected Task's Id. * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. * The `value` property of the result is the GUID of the resource as a string. * */ getSelectedTaskAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Project documents only. Get the current selected Task's Id. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. * The `value` property of the result is the GUID of the resource as a string. * */ getSelectedTaskAsync(callback?: (result: AsyncResult) => void): void; /** * Project documents only. Get the current selected View Type (Ex. Gantt) and View Name. * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. * The `value` property of the result contains the following properties: * `viewName` - The name of the view, as a ProjectViewTypes constant. * `viewType` - The type of view, as the integer value of a ProjectViewTypes constant. * */ getSelectedViewAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Project documents only. Get the current selected View Type (Ex. Gantt) and View Name. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. * The `value` property of the result contains the following properties: * `viewName` - The name of the view, as a ProjectViewTypes constant. * `viewType` - The type of view, as the integer value of a ProjectViewTypes constant. * */ getSelectedViewAsync(callback?: (result: AsyncResult) => void): void; /** * Project documents only. Get the Task Name, WSS Task Id, and ResourceNames for given taskId. * @param taskId Either a string or value of the Task Id. * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. * The `value` property of the result contains the following properties: * `taskName` - The name of the task. * `wssTaskId` - The ID of the task in the synchronized SharePoint task list. If the project is not synchronized with a SharePoint task list, the value is 0. * `resourceNames` - The comma-separated list of the names of resources that are assigned to the task. * */ getTaskAsync(taskId: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Project documents only. Get the Task Name, WSS Task Id, and ResourceNames for given taskId. * @param taskId Either a string or value of the Task Id. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. * The `value` property of the result contains the following properties: * `taskName` - The name of the task. * `wssTaskId` - The ID of the task in the synchronized SharePoint task list. If the project is not synchronized with a SharePoint task list, the value is 0. * `resourceNames` - The comma-separated list of the names of resources that are assigned to the task. * */ getTaskAsync(taskId: string, callback?: (result: AsyncResult) => void): void; /** * Project documents only. Get task field for provided task Id. (Ex. StartDate). * @param taskId Either a string or value of the Task Id. * @param fieldId Task Fields. * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. * The `value` property of the result contains the `fieldValue` property, which represents the value of the specified field. * */ getTaskFieldAsync(taskId: string, fieldId: number, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Project documents only. Get task field for provided task Id. (Ex. StartDate). * @param taskId Either a string or value of the Task Id. * @param fieldId Task Fields. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. * The `value` property of the result contains the `fieldValue` property, which represents the value of the specified field. * */ getTaskFieldAsync(taskId: string, fieldId: number, callback?: (result: AsyncResult) => void): void; /** * Project documents only. Get the WSS Url and list name for the Tasks List, the MPP is synced too. * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. * The `value` property of the result contains the following properties: * `listName` - the name of the synchronized SharePoint task list. * `serverUrl` - the URL of the synchronized SharePoint task list. * */ getWSSUrlAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Project documents only. Get the WSS Url and list name for the Tasks List, the MPP is synced too. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. * The `value` property of the result contains the following properties: * `listName` - the name of the synchronized SharePoint task list. * `serverUrl` - the URL of the synchronized SharePoint task list. * */ getWSSUrlAsync(callback?: (result: AsyncResult) => void): void; /** * Project documents only. Get the maximum index of the collection of resources in the current project. * * **Important**: This API works only in Project 2016 on Windows desktop. * * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. * The `value` property of the result is the highest index number in the current project's resource collection. * */ getMaxResourceIndexAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Project documents only. Get the maximum index of the collection of resources in the current project. * * **Important**: This API works only in Project 2016 on Windows desktop. * * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. * The `value` property of the result is the highest index number in the current project's resource collection. * */ getMaxResourceIndexAsync(callback?: (result: AsyncResult) => void): void; /** * Project documents only. Get the maximum index of the collection of tasks in the current project. * * **Important**: This API works only in Project 2016 on Windows desktop. * * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. * The `value` property of the result is the highest index number in the current project's task collection. * */ getMaxTaskIndexAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Project documents only. Get the maximum index of the collection of tasks in the current project. * * **Important**: This API works only in Project 2016 on Windows desktop. * * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. * The `value` property of the result is the highest index number in the current project's task collection. * */ getMaxTaskIndexAsync(callback?: (result: AsyncResult) => void): void; /** * Project documents only. Get the GUID of the resource that has the specified index in the resource collection. * * **Important**: This API works only in Project 2016 on Windows desktop. * * @param resourceIndex The index of the resource in the collection of resources for the project. * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. * The `value` property of the result is the GUID of the resource as a string. * */ getResourceByIndexAsync(resourceIndex: number, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Project documents only. Get the GUID of the resource that has the specified index in the resource collection. * * **Important**: This API works only in Project 2016 on Windows desktop. * * @param resourceIndex The index of the resource in the collection of resources for the project. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. * The `value` property of the result is the GUID of the resource as a string. * */ getResourceByIndexAsync(resourceIndex: number, callback?: (result: AsyncResult) => void): void; /** * Project documents only. Get the GUID of the task that has the specified index in the task collection. * * **Important**: This API works only in Project 2016 on Windows desktop. * * @param taskIndex The index of the task in the collection of tasks for the project. * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. * The `value` property of the result is the GUID of the task as a string. * */ getTaskByIndexAsync(taskIndex: number, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Project documents only. Get the GUID of the task that has the specified index in the task collection. * * **Important**: This API works only in Project 2016 on Windows desktop. * * @param taskIndex The index of the task in the collection of tasks for the project. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. * The `value` property of the result is the GUID of the task as a string. * */ getTaskByIndexAsync(taskIndex: number, callback?: (result: AsyncResult) => void): void; /** * Project documents only. Set resource field for specified resource Id. * * **Important**: This API works only in Project 2016 on Windows desktop. * * @param resourceId Either a string or value of the Resource Id. * @param fieldId Resource Fields. * @param fieldValue Value of the target field. * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. * */ setResourceFieldAsync(resourceId: string, fieldId: number, fieldValue: string | number | boolean | object, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Project documents only. Set resource field for specified resource Id. * * **Important**: This API works only in Project 2016 on Windows desktop. * * @param resourceId Either a string or value of the Resource Id. * @param fieldId Resource Fields. * @param fieldValue Value of the target field. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. * */ setResourceFieldAsync(resourceId: string, fieldId: number, fieldValue: string | number | boolean | object, callback?: (result: AsyncResult) => void): void; /** * Project documents only. Set task field for specified task Id. * * **Important**: This API works only in Project 2016 on Windows desktop. * * @param taskId Either a string or value of the Task Id. * @param fieldId Task Fields. * @param fieldValue Value of the target field. * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. * */ setTaskFieldAsync(taskId: string, fieldId: number, fieldValue: string | number | boolean | object, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Project documents only. Set task field for specified task Id. * * **Important**: This API works only in Project 2016 on Windows desktop. * * @param taskId Either a string or value of the Task Id. * @param fieldId Task Fields. * @param fieldValue Value of the target field. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. * */ setTaskFieldAsync(taskId: string, fieldId: number, fieldValue: string | number | boolean | object, callback?: (result: AsyncResult) => void): void; } /** * Provides information about the document that raised the SelectionChanged event. */ interface DocumentSelectionChangedEventArgs { /** * Gets an {@link Office.Document} object that represents the document that raised the SelectionChanged event. */ document: Document; /** * Get an {@link Office.EventType} enumeration value that identifies the kind of event that was raised. */ type: EventType; } /** * Represents the document file associated with an Office Add-in. * * @remarks * * Access the File object with the AsyncResult.value property in the callback function passed to the Document.getFileAsync method. * */ interface File { /** * Gets the document file size in bytes. */ size: number; /** * Gets the number of slices into which the file is divided. */ sliceCount: number; /** * Closes the document file. * * @remarks * * **Requirement set**: {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#file | File} * * No more than two documents are allowed to be in memory; otherwise the Document.getFileAsync operation will fail. Use the File.closeAsync * method to close the file when you are finished working with it. * * In the callback function passed to the closeAsync method, you can use the properties of the AsyncResult object to return the following * information. * * * * * * * * * * * * * * * * * * * * * * *
PropertyUse
AsyncResult.valueAlways returns undefined because there is no object or data to retrieve
AsyncResult.statusDetermine the success or failure of the operation
AsyncResult.errorAccess an Error object that provides error information if the operation failed
AsyncResult.asyncContextDefine an item of any type that is returned in the AsyncResult object without being altered
* * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. */ closeAsync(callback?: (result: AsyncResult) => void): void; /** * Returns the specified slice. * * @remarks * * **Requirement set**: {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#file | File} * * In the callback function passed to the getSliceAsync method, you can use the properties of the AsyncResult object to return the following * information. * * * * * * * * * * * * * * * * * * * * * * *
PropertyUse
AsyncResult.valueAccess the Slice object
AsyncResult.statusDetermine the success or failure of the operation
AsyncResult.errorAccess an Error object that provides error information if the operation failed
AsyncResult.asyncContextDefine an item of any type that is returned in the AsyncResult object without being altered
* * @param sliceIndex Specifies the zero-based index of the slice to be retrieved. Required. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. * The `value` property of the result is the {@link Office.Slice} object. */ getSliceAsync(sliceIndex: number, callback?: (result: AsyncResult) => void): void; } interface FileProperties { /** * File's URL */ url: string } /** * Represents a binding in two dimensions of rows and columns. * * @remarks * * The MatrixBinding object inherits the `id` property, type property, getDataAsync method, and setDataAsync method from the Binding object. */ interface MatrixBinding extends Binding { /** * Gets the number of columns in the matrix data structure, as an integer value. */ columnCount: number; /** * Gets the number of rows in the matrix data structure, as an integer value. */ rowCount: number; } /** * Represents custom settings for a task pane or content add-in that are stored in the host document as name/value pairs. * * @remarks * * **Applications**: Excel, PowerPoint, Word * * The settings created by using the methods of the Settings object are saved per add-in and per document. * That is, they are available only to the add-in that created them, and only from the document in which they are saved. * * The name of a setting is a string, while the value can be a string, number, boolean, null, object, or array. * * The Settings object is automatically loaded as part of the Document object, and is available by calling the settings property of that object * when the add-in is activated. * * The developer is responsible for calling the saveAsync method after adding or deleting settings to save the settings in the document. */ interface Settings { /** * Adds an event handler for the settingsChanged event. * * **Important**: Your add-in's code can register a handler for the settingsChanged event when the add-in is running with any Excel client, but * the event will fire only when the add-in is loaded with a spreadsheet that is opened in Excel on the web, and more than one user is editing the * spreadsheet (coauthoring). Therefore, effectively the settingsChanged event is supported only in Excel on the web in coauthoring scenarios. * * @remarks * * **Requirement set**: {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#methods-that-arent-part-of-a-requirement-set | Not in a set} * * You can add multiple event handlers for the specified eventType as long as the name of each event handler function is unique. * * @param eventType Specifies the type of event to add. Required. * @param handler The event handler function to add, whose only parameter is of type {@link Office.SettingsChangedEventArgs}. Required. * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. * * * * * * * * * * * * * * * * * * * * * * *
PropertyUse
AsyncResult.valueAlways returns undefined because there is no data or object to retrieve when adding an event handler
AsyncResult.statusDetermine the success or failure of the operation
AsyncResult.errorAccess an Error object that provides error information if the operation failed
AsyncResult.asyncContextDefine an item of any type that is returned in the AsyncResult object without being altered
*/ addHandlerAsync(eventType: Office.EventType, handler: any, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Adds an event handler for the settingsChanged event. * * **Important**: Your add-in's code can register a handler for the settingsChanged event when the add-in is running with any Excel client, but * the event will fire only when the add-in is loaded with a spreadsheet that is opened in Excel on the web, and more than one user is editing the * spreadsheet (coauthoring). Therefore, effectively the settingsChanged event is supported only in Excel on the web in coauthoring scenarios. * * @remarks * * **Requirement set**: {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#methods-that-arent-part-of-a-requirement-set | Not in a set} * * You can add multiple event handlers for the specified eventType as long as the name of each event handler function is unique. * * @param eventType Specifies the type of event to add. Required. * @param handler The event handler function to add, whose only parameter is of type {@link Office.SettingsChangedEventArgs}. Required. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. * * * * * * * * * * * * * * * * * * * * * * *
PropertyUse
AsyncResult.valueAlways returns undefined because there is no data or object to retrieve when adding an event handler
AsyncResult.statusDetermine the success or failure of the operation
AsyncResult.errorAccess an Error object that provides error information if the operation failed
AsyncResult.asyncContextDefine an item of any type that is returned in the AsyncResult object without being altered
*/ addHandlerAsync(eventType: Office.EventType, handler: any, callback?: (result: AsyncResult) => void): void; /** * Retrieves the specified setting. * * @remarks * * **Requirement set**: {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#settings | Settings} * * @param settingName The case-sensitive name of the setting to retrieve. * @returns An object that has property names mapped to JSON serialized values. */ get(name: string): any; /** * Reads all settings persisted in the document and refreshes the content or task pane add-in's copy of those settings held in memory. * * @remarks * * **Requirement set**: {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#methods-that-arent-part-of-a-requirement-set | Not in a set} * * This method is useful in Excel, Word, and PowerPoint coauthoring scenarios when multiple instances of the same add-in are working against * the same document. Because each add-in is working against an in-memory copy of the settings loaded from the document at the time the user * opened it, the settings values used by each user can get out of sync. This can happen whenever an instance of the add-in calls the * Settings.saveAsync method to persist all of that user's settings to the document. Calling the refreshAsync method from the event handler * for the settingsChanged event of the add-in will refresh the settings values for all users. * * In the callback function passed to the refreshAsync method, you can use the properties of the AsyncResult object to return the following * information. * * * * * * * * * * * * * * * * * * * * * * *
PropertyUse
AsyncResult.valueAccess a Settings object with the refreshed values
AsyncResult.statusDetermine the success or failure of the operation
AsyncResult.errorAccess an Error object that provides error information if the operation failed
AsyncResult.asyncContextDefine an item of any type that is returned in the AsyncResult object without being altered
* * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. * The `value` property of the result is an {@link Office.Settings} object with the refreshed values. */ refreshAsync(callback?: (result: AsyncResult) => void): void; /** * Removes the specified setting. * * **Important**: Be aware that the Settings.remove method affects only the in-memory copy of the settings property bag. To persist the removal of * the specified setting in the document, at some point after calling the Settings.remove method and before the add-in is closed, you must * call the Settings.saveAsync method. * * @remarks * * **Requirement set**: {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#settings | Settings} * * null is a valid value for a setting. Therefore, assigning null to the setting will not remove it from the settings property bag. * * @param settingName The case-sensitive name of the setting to remove. */ remove(name: string): void; /** * Removes an event handler for the settingsChanged event. * * @remarks * * **Requirement set**: {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#methods-that-arent-part-of-a-requirement-set | Not in a set} * * If the optional handler parameter is omitted when calling the removeHandlerAsync method, all event handlers for the specified eventType * will be removed. * * When the function you passed to the callback parameter executes, it receives an AsyncResult object that you can access from the callback * function's only parameter. * * In the callback function passed to the removeHandlerAsync method, you can use the properties of the AsyncResult object to return the * following information. * * * * * * * * * * * * * * * * * * * * * * *
PropertyUse
AsyncResult.valueAlways returns undefined because there is no data or object to retrieve when setting formats
AsyncResult.statusDetermine the success or failure of the operation
AsyncResult.errorAccess an Error object that provides error information if the operation failed
AsyncResult.asyncContextDefine an item of any type that is returned in the AsyncResult object without being altered
* * @param eventType Specifies the type of event to remove. Required. * @param options Provides options to determine which event handler or handlers are removed. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. */ removeHandlerAsync(eventType: Office.EventType, options?: RemoveHandlerOptions, callback?: (result: AsyncResult) => void): void; /** * Removes an event handler for the settingsChanged event. * * @remarks * * **Requirement set**: {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#methods-that-arent-part-of-a-requirement-set | Not in a set} * * If the optional handler parameter is omitted when calling the removeHandlerAsync method, all event handlers for the specified eventType * will be removed. * * When the function you passed to the callback parameter executes, it receives an AsyncResult object that you can access from the callback * function's only parameter. * * In the callback function passed to the removeHandlerAsync method, you can use the properties of the AsyncResult object to return the * following information. * * * * * * * * * * * * * * * * * * * * * * *
PropertyUse
AsyncResult.valueAlways returns undefined because there is no data or object to retrieve when setting formats
AsyncResult.statusDetermine the success or failure of the operation
AsyncResult.errorAccess an Error object that provides error information if the operation failed
AsyncResult.asyncContextDefine an item of any type that is returned in the AsyncResult object without being altered
* * @param eventType Specifies the type of event to remove. Required. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. */ removeHandlerAsync(eventType: Office.EventType, callback?: (result: AsyncResult) => void): void; /** * Persists the in-memory copy of the settings property bag in the document. * * @remarks * * **Requirement set**: {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#settings | Settings} * * Any settings previously saved by an add-in are loaded when it is initialized, so during the lifetime of the session you can just use the * set and get methods to work with the in-memory copy of the settings property bag. When you want to persist the settings so that they are * available the next time the add-in is used, use the saveAsync method. * * **Note**: The saveAsync method persists the in-memory settings property bag into the document file. However, the changes to the document file * itself are saved only when the user (or AutoRecover setting) saves the document to the file system. The refreshAsync method is only useful * in coauthoring scenarios when other instances of the same add-in might change the settings and those changes should be made available to * all instances. * * * * * * * * * * * * * * * * * * * * * * *
PropertyUse
AsyncResult.valueAlways returns undefined because there is no object or data to retrieve
AsyncResult.statusDetermine the success or failure of the operation
AsyncResult.errorAccess an Error object that provides error information if the operation failed
AsyncResult.asyncContextDefine an item of any type that is returned in the AsyncResult object without being altered
* * @param options Provides options for saving settings. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. */ saveAsync(options?: SaveSettingsOptions, callback?: (result: AsyncResult) => void): void; /** * Persists the in-memory copy of the settings property bag in the document. * * @remarks * * **Requirement set**: {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#settings | Settings} * * Any settings previously saved by an add-in are loaded when it is initialized, so during the lifetime of the session you can just use the * set and get methods to work with the in-memory copy of the settings property bag. When you want to persist the settings so that they are * available the next time the add-in is used, use the saveAsync method. * * **Note**: The saveAsync method persists the in-memory settings property bag into the document file. However, the changes to the document file * itself are saved only when the user (or AutoRecover setting) saves the document to the file system. The refreshAsync method is only useful * in coauthoring scenarios when other instances of the same add-in might change the settings and those changes should be made available to * all instances. * * * * * * * * * * * * * * * * * * * * * * *
PropertyUse
AsyncResult.valueAlways returns undefined because there is no object or data to retrieve
AsyncResult.statusDetermine the success or failure of the operation
AsyncResult.errorAccess an Error object that provides error information if the operation failed
AsyncResult.asyncContextDefine an item of any type that is returned in the AsyncResult object without being altered
* * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. */ saveAsync(callback?: (result: AsyncResult) => void): void; /** * Sets or creates the specified setting. * * **Important**: Be aware that the Settings.set method affects only the in-memory copy of the settings property bag. * To make sure that additions or changes to settings will be available to your add-in the next time the document is opened, at some point * after calling the Settings.set method and before the add-in is closed, you must call the Settings.saveAsync method to persist settings in * the document. * * @remarks * * **Requirement set**: {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#settings | Settings} * * The set method creates a new setting of the specified name if it does not already exist, or sets an existing setting of the specified name * in the in-memory copy of the settings property bag. After you call the Settings.saveAsync method, the value is stored in the document as * the serialized JSON representation of its data type. * * @param settingName The case-sensitive name of the setting to set or create. * @param value Specifies the value to be stored. */ set(name: string, value: any): void; } /** * Provides information about the settings that raised the settingsChanged event. * * To add an event handler for the settingsChanged event, use the addHandlerAsync method of the * {@link Office.Settings} object. * * The settingsChanged event fires only when your add-in's script calls the Settings.saveAsync method to persist * the in-memory copy of the settings into the document file. The settingsChanged event is not triggered when the * Settings.set or Settings.remove methods are called. * * The settingsChanged event was designed to let you to handle potential conflicts when two or more users are * attempting to save settings at the same time when your add-in is used in a shared (coauthored) document. * * **Important**: Your add-in's code can register a handler for the settingsChanged event when the add-in * is running with any Excel client, but the event will fire only when the add-in is loaded with a spreadsheet * that is opened in Excel on the web, and more than one user is editing the spreadsheet (coauthoring). * Therefore, effectively the settingsChanged event is supported only in Excel on the web in coauthoring scenarios. */ interface SettingsChangedEventArgs { /** * Gets an {@link Office.Settings} object that represents the settings that raised the settingsChanged event. */ settings: Settings; /** * Get an {@link Office.EventType} enumeration value that identifies the kind of event that was raised. */ type: EventType; } /** * Provides options for how to send messages, in either direction, between a dialog and its parent. * * @remarks * * **Requirement set**: {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/dialog-origin-requirement-sets | DialogOrigin 1.1} */ interface DialogMessageOptions { /** * Specifies the intended recipient domain for a message sent, in either direction, between a dialog and its parent. For example, `https://resources.contoso.com`. */ targetOrigin: string; } /** * Provides information about the message from the parent page that raised the `DialogParentMessageReceived` event. * * To add an event handler for the `DialogParentMessageReceived` event, use the `addHandlerAsync` method of the * {@link Office.UI} object. * */ interface DialogParentMessageReceivedEventArgs { /** * Gets the content of the message sent from the parent page, which can be any string or stringified data. */ message: string; /** * Gets the domain of the parent page that called `Dialog.messageChild`. * * @remarks * * **Requirement set**: {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/dialog-origin-requirement-sets | DialogOrigin 1.1}. * The property is `undefined` on clients that do not support this requirement set. */ origin: string | undefined; /** * Gets an {@link Office.EventType} enumeration value that identifies the kind of event that was raised. */ type: EventType; } /** * Represents a slice of a document file. The Slice object is accessed with the `File.getSliceAsync` method. */ interface Slice { /** * Gets the raw data of the file slice in `Office.FileType.Text` or `Office.FileType.Compressed` format as specified * by the `fileType` parameter of the call to the `Document.getFileAsync` method. * * @remarks * * Files in the "compressed" format will return a byte array that can be transformed to a base64-encoded string if required. */ data: any; /** * Gets the zero-based index of the file slice. */ index: number; /** * Gets the size of the slice in bytes. */ size: number; } /** * Represents a binding in two dimensions of rows and columns, optionally with headers. * * @remarks * * The TableBinding object inherits the `id` property, `type` property, `getDataAsync` method, and `setDataAsync` method from the * {@link Office.Binding} object. * * For Excel, note that after you establish a table binding, each new row a user adds to the table is automatically included in the binding and * rowCount increases. */ interface TableBinding extends Binding { /** * Gets the number of columns in the TableBinding, as an integer value. */ columnCount: number; /** * True, if the table has headers; otherwise false. */ hasHeaders: boolean; /** * Gets the number of rows in the TableBinding, as an integer value. * * @remarks * * When you insert an empty table by selecting a single row in Excel 2013 and Excel on the web (using Table on the Insert tab), both Office * applications create a single row of headers followed by a single blank row. However, if your add-in's script creates a binding for this * newly inserted table (for example, by using the {@link Office.Bindings}.addFromSelectionAsync method), and then checks the value of the * rowCount property, the value returned will differ depending whether the spreadsheet is open in Excel 2013 or Excel on the web. * * - In Excel on the desktop, rowCount will return 0 (the blank row following the headers is not counted). * * - In Excel on the web, rowCount will return 1 (the blank row following the headers is counted). * * You can work around this difference in your script by checking if rowCount == 1, and if so, then checking if the row contains all empty * strings. */ rowCount: number; /** * Adds the specified data to the table as additional columns. * * @remarks * * To add one or more columns specifying the values of the data and headers, pass a TableData object as the data parameter. To add one or more * columns specifying only the data, pass an array of arrays ("matrix") as the data parameter. * * The success or failure of an addColumnsAsync operation is atomic. That is, the entire add columns operation must succeed, or it will be * completely rolled back (and the AsyncResult.status property returned to the callback will report failure): * * - Each row in the array you pass as the data argument must have the same number of rows as the table being updated. If not, the entire * operation will fail. * * - Each row and cell in the array must successfully add that row or cell to the table in the newly added columns. If any row or cell * fails to be set for any reason, the entire operation will fail. * * - If you pass a TableData object as the data argument, the number of header rows must match that of the table being updated. * * Additional remark for Excel on the web: The total number of cells in the TableData object passed to the data parameter can't exceed 20,000 in * a single call to this method. * * @param tableData An array of arrays ("matrix") or a TableData object that contains one or more columns of data to add to the table. Required. * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. */ addColumnsAsync(tableData: TableData | any[][], options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Adds the specified data to the table as additional columns. * * @remarks * * To add one or more columns specifying the values of the data and headers, pass a TableData object as the data parameter. To add one or more * columns specifying only the data, pass an array of arrays ("matrix") as the data parameter. * * The success or failure of an addColumnsAsync operation is atomic. That is, the entire add columns operation must succeed, or it will be * completely rolled back (and the AsyncResult.status property returned to the callback will report failure): * * - Each row in the array you pass as the data argument must have the same number of rows as the table being updated. If not, the entire * operation will fail. * * - Each row and cell in the array must successfully add that row or cell to the table in the newly added columns. If any row or cell * fails to be set for any reason, the entire operation will fail. * * - If you pass a TableData object as the data argument, the number of header rows must match that of the table being updated. * * Additional remark for Excel on the web: The total number of cells in the TableData object passed to the data parameter can't exceed 20,000 in * a single call to this method. * * @param tableData An array of arrays ("matrix") or a TableData object that contains one or more columns of data to add to the table. Required. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. */ addColumnsAsync(tableData: TableData | any[][], callback?: (result: AsyncResult) => void): void; /** * Adds the specified data to the table as additional rows. * * @remarks * * The success or failure of an addRowsAsync operation is atomic. That is, the entire add columns operation must succeed, or it will be * completely rolled back (and the AsyncResult.status property returned to the callback will report failure): * * - Each row in the array you pass as the data argument must have the same number of columns as the table being updated. If not, the entire * operation will fail. * * - Each column and cell in the array must successfully add that column or cell to the table in the newly added rows. If any column or * cell fails to be set for any reason, the entire operation will fail. * * - If you pass a TableData object as the data argument, the number of header rows must match that of the table being updated. * * Additional remark for Excel on the web: The total number of cells in the TableData object passed to the data parameter can't exceed 20,000 in * a single call to this method. * * @param rows An array of arrays ("matrix") or a TableData object that contains one or more rows of data to add to the table. Required. * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. */ addRowsAsync(rows: TableData | any[][], options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Adds the specified data to the table as additional rows. * * @remarks * * The success or failure of an addRowsAsync operation is atomic. That is, the entire add columns operation must succeed, or it will be * completely rolled back (and the AsyncResult.status property returned to the callback will report failure): * * - Each row in the array you pass as the data argument must have the same number of columns as the table being updated. If not, the entire * operation will fail. * * - Each column and cell in the array must successfully add that column or cell to the table in the newly added rows. If any column or * cell fails to be set for any reason, the entire operation will fail. * * - If you pass a TableData object as the data argument, the number of header rows must match that of the table being updated. * * Additional remark for Excel on the web: The total number of cells in the TableData object passed to the data parameter can't exceed 20,000 in * a single call to this method. * * @param rows An array of arrays ("matrix") or a TableData object that contains one or more rows of data to add to the table. Required. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. */ addRowsAsync(rows: TableData | any[][], callback?: (result: AsyncResult) => void): void; /** * Deletes all non-header rows and their values in the table, shifting appropriately for the Office application. * * @remarks * * In Excel, if the table has no header row, this method will delete the table itself. * * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. */ deleteAllDataValuesAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Deletes all non-header rows and their values in the table, shifting appropriately for the Office application. * * @remarks * * In Excel, if the table has no header row, this method will delete the table itself. * * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. */ deleteAllDataValuesAsync(callback?: (result: AsyncResult) => void): void; /** * Clears formatting on the bound table. * * @remarks * * See {@link https://learn.microsoft.com/office/dev/add-ins/excel/excel-add-ins-tables#format-a-table | Format tables in add-ins for Excel} for more information. * * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. */ clearFormatsAsync(options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Clears formatting on the bound table. * * @remarks * * See {@link https://learn.microsoft.com/office/dev/add-ins/excel/excel-add-ins-tables#format-a-table | Format tables in add-ins for Excel} for more information. * * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. */ clearFormatsAsync(callback?: (result: AsyncResult) => void): void; /** * Gets the formatting on specified items in the table. * * @remarks * * **Returned format structure** * * Each JavaScript object in the return value array has this form: `{cells:{ cell_range }, format:{ format_definition }}` * * The `cells:` property specifies the range you want format using one of the following values. * * **Supported ranges in cells property** * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
cells range settingsDescription
{row: n}Specifies the range that is the zero-based nth row of data in the table.
{column: n}Specifies the range that is the zero-based nth column of data in the table.
{row: i, column: j}Specifies the single cell that is the ith row and jth column of the table.
Office.Table.AllSpecifies the entire table, including column headers, data, and totals (if any).
Office.Table.DataSpecifies only the data in the table (no headers and totals).
Office.Table.HeadersSpecifies only the header row.
* * The `format:` property specifies values that correspond to a subset of the settings available in the Format Cells dialog box in Excel * (Right-click then select **Format Cells**, or **Home** \> **Format** \> **Format Cells**). * * @param cellReference An object literal containing name-value pairs that specify the range of cells to get formatting from. * @param formats An array specifying the format properties to get. * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. * The `value` property of the result is an array containing one or more JavaScript objects specifying the formatting of their corresponding cells. */ getFormatsAsync(cellReference?: any, formats?: any[], options?: Office.AsyncContextOptions, callback?: (result: AsyncResult< ({ cells: any, format: any})[]>) => void): void; /** * Gets the formatting on specified items in the table. * * @remarks * * **Returned format structure** * * Each JavaScript object in the return value array has this form: `{cells:{ cell_range }, format:{ format_definition }}` * * The `cells:` property specifies the range you want format using one of the following values. * * **Supported ranges in cells property** * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
cells range settingsDescription
{row: n}Specifies the range that is the zero-based nth row of data in the table.
{column: n}Specifies the range that is the zero-based nth column of data in the table.
{row: i, column: j}Specifies the single cell that is the ith row and jth column of the table.
Office.Table.AllSpecifies the entire table, including column headers, data, and totals (if any).
Office.Table.DataSpecifies only the data in the table (no headers and totals).
Office.Table.HeadersSpecifies only the header row.
* * The `format:` property specifies values that correspond to a subset of the settings available in the Format Cells dialog box in Excel * (Right-click then select **Format Cells**, or **Home** \> **Format** \> **Format Cells**). * * @param cellReference An object literal containing name-value pairs that specify the range of cells to get formatting from. * @param formats An array specifying the format properties to get. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. * The `value` property of the result is an array containing one or more JavaScript objects specifying the formatting of their corresponding cells. */ getFormatsAsync(cellReference?: any, formats?: any[], callback?: (result: AsyncResult< ({ cells: any, format: any})[]>) => void): void; /** * Sets formatting on specified items and data in the table. * * @remarks * * **Specifying the cellFormat parameter** * * Use the cellFormat parameter to set or change cell formatting values, such as width, height, font, background, alignment, and so on. * The value you pass as the cellFormat parameter is an array that contains a list of one or more JavaScript objects that specify which cells * to target (`cells:`) and the formats (`format:`) to apply to them. * * Each JavaScript object in the cellFormat array has this form: `{cells:{ cell_range }, format:{ format_definition }}` * * The `cells:` property specifies the range you want format using one of the following values. * * **Supported ranges in cells property** * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
cells range settingsDescription
{row: n}Specifies the range that is the zero-based nth row of data in the table.
{column: n}Specifies the range that is the zero-based nth column of data in the table.
{row: i, column: j}Specifies the single cell that is the ith row and jth column of the table.
Office.Table.AllSpecifies the entire table, including column headers, data, and totals (if any).
Office.Table.DataSpecifies only the data in the table (no headers and totals).
Office.Table.HeadersSpecifies only the header row.
* * The `format:` property specifies values that correspond to a subset of the settings available in the Format Cells dialog box in Excel * (Right-click then select **Format Cells**, or **Home** \> **Format** \> **Format Cells**). * * You specify the value of the `format:` property as a list of one or more property name - value pairs in a JavaScript object literal. The * property name specifies the name of the formatting property to set, and value specifies the property value. * You can specify multiple values for a given format, such as both a font's color and size. * * Here's three `format:` property value examples: * * `//Set cells: font color to green and size to 15 points.` * * `format: {fontColor : "green", fontSize : 15}` * * `//Set cells: border to dotted blue.` * * `format: {borderStyle: "dotted", borderColor: "blue"}` * * `//Set cells: background to red and alignment to centered.` * * `format: {backgroundColor: "red", alignHorizontal: "center"}` * * * You can specify number formats by specifying the number formatting "code" string in the `numberFormat:` property. * The number format strings you can specify correspond to those you can set in Excel using the Custom category on the Number tab of the Format Cells dialog box. * This example shows how to format a number as a percentage with two decimal places: * * `format: {numberFormat:"0.00%"}` * * For more detail, see how to {@link https://support.microsoft.com/office/78f2a361-936b-4c03-8772-09fab54be7f4 | Create a custom number format}. * * To set formatting on tables when writing data, use the tableOptions and cellFormat optional parameters of the * `Document.setSelectedDataAsync` or `TableBinding.setDataAsync` methods. * * Setting formatting with the optional parameters of the `Document.setSelectedDataAsync` and `TableBinding.setDataAsync` methods only works * to set formatting when writing data the first time. * To make formatting changes after writing data, use the following methods. * * - To update cell formatting, such as font color and style, use the `TableBinding.setFormatsAsync` method (this method). * * - To update table options, such as banded rows and filter buttons, use the `TableBinding.setTableOptions` method. * * - To clear formatting, use the `TableBinding.clearFormats` method. * * For more details and examples, see * {@link https://learn.microsoft.com/office/dev/add-ins/excel/excel-add-ins-tables#format-a-table | How to format tables in add-ins for Excel}. * * @param cellFormat An array that contains one or more JavaScript objects that specify which cells to target and the formatting to apply to them. * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. */ setFormatsAsync(cellFormat: any[], options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Sets formatting on specified items and data in the table. * * @remarks * * **Specifying the cellFormat parameter** * * Use the cellFormat parameter to set or change cell formatting values, such as width, height, font, background, alignment, and so on. * The value you pass as the cellFormat parameter is an array that contains a list of one or more JavaScript objects that specify which cells * to target (`cells:`) and the formats (`format:`) to apply to them. * * Each JavaScript object in the cellFormat array has this form: `{cells:{ cell_range }, format:{ format_definition }}` * * The `cells:` property specifies the range you want format using one of the following values. * * **Supported ranges in cells property** * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
cells range settingsDescription
{row: n}Specifies the range that is the zero-based nth row of data in the table.
{column: n}Specifies the range that is the zero-based nth column of data in the table.
{row: i, column: j}Specifies the single cell that is the ith row and jth column of the table.
Office.Table.AllSpecifies the entire table, including column headers, data, and totals (if any).
Office.Table.DataSpecifies only the data in the table (no headers and totals).
Office.Table.HeadersSpecifies only the header row.
* * The `format:` property specifies values that correspond to a subset of the settings available in the Format Cells dialog box in Excel * (Right-click then select **Format Cells**, or **Home** \> **Format** \> **Format Cells**). * * You specify the value of the `format:` property as a list of one or more property name - value pairs in a JavaScript object literal. The * property name specifies the name of the formatting property to set, and value specifies the property value. * You can specify multiple values for a given format, such as both a font's color and size. * * Here's three `format:` property value examples: * * `//Set cells: font color to green and size to 15 points.` * * `format: {fontColor : "green", fontSize : 15}` * * `//Set cells: border to dotted blue.` * * `format: {borderStyle: "dotted", borderColor: "blue"}` * * `//Set cells: background to red and alignment to centered.` * * `format: {backgroundColor: "red", alignHorizontal: "center"}` * * * You can specify number formats by specifying the number formatting "code" string in the `numberFormat:` property. * The number format strings you can specify correspond to those you can set in Excel using the Custom category on the Number tab of the Format Cells dialog box. * This example shows how to format a number as a percentage with two decimal places: * * `format: {numberFormat:"0.00%"}` * * For more detail, see how to {@link https://support.microsoft.com/office/78f2a361-936b-4c03-8772-09fab54be7f4 | Create a custom number format}. * * To set formatting on tables when writing data, use the tableOptions and cellFormat optional parameters of the * `Document.setSelectedDataAsync` or `TableBinding.setDataAsync` methods. * * Setting formatting with the optional parameters of the `Document.setSelectedDataAsync` and `TableBinding.setDataAsync` methods only works * to set formatting when writing data the first time. * To make formatting changes after writing data, use the following methods. * * - To update cell formatting, such as font color and style, use the `TableBinding.setFormatsAsync` method (this method). * * - To update table options, such as banded rows and filter buttons, use the `TableBinding.setTableOptions` method. * * - To clear formatting, use the `TableBinding.clearFormats` method. * * For more details and examples, see * {@link https://learn.microsoft.com/office/dev/add-ins/excel/excel-add-ins-tables#format-a-table | How to format tables in add-ins for Excel}. * * @param cellFormat An array that contains one or more JavaScript objects that specify which cells to target and the formatting to apply to them. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. */ setFormatsAsync(cellFormat: any[], callback?: (result: AsyncResult) => void): void; /** * Updates table formatting options on the bound table. * * @remarks * * **Requirement set**: {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#methods-that-arent-part-of-a-requirement-set | Not in a set} * * In the callback function passed to the goToByIdAsync method, you can use the properties of the AsyncResult object to return the following information. * * * * * * * * * * * * * * * * * * * * * * *
PropertyUse
AsyncResult.valueAlways returns undefined because there is no data or object to retrieve when setting formats
AsyncResult.statusDetermine the success or failure of the operation
AsyncResult.errorAccess an Error object that provides error information if the operation failed
AsyncResult.asyncContextDefine an item of any type that is returned in the AsyncResult object without being altered
* * @param tableOptions An object literal containing a list of property name-value pairs that define the table options to apply. * @param options Provides an option for preserving context data of any type, unchanged, for use in a callback. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. * */ setTableOptionsAsync(tableOptions: any, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Updates table formatting options on the bound table. * * @remarks * * **Requirement set**: {@link https://learn.microsoft.com/javascript/api/requirement-sets/common/office-add-in-requirement-sets#methods-that-arent-part-of-a-requirement-set | Not in a set} * * In the callback function passed to the goToByIdAsync method, you can use the properties of the AsyncResult object to return the following information. * * * * * * * * * * * * * * * * * * * * * * *
PropertyUse
AsyncResult.valueAlways returns undefined because there is no data or object to retrieve when setting formats
AsyncResult.statusDetermine the success or failure of the operation
AsyncResult.errorAccess an Error object that provides error information if the operation failed
AsyncResult.asyncContextDefine an item of any type that is returned in the AsyncResult object without being altered
* * @param tableOptions An object literal containing a list of property name-value pairs that define the table options to apply. * @param callback Optional. A function that is invoked when the callback returns, whose only parameter is of type {@link Office.AsyncResult}. * */ setTableOptionsAsync(tableOptions: any, callback?: (result: AsyncResult) => void): void; } /** * Represents the data in a table or an {@link Office.TableBinding}. */ class TableData { constructor(rows: any[][], headers: any[]); constructor(); /** * Gets or sets the headers of the table. * * @remarks * * To specify headers, you must specify an array of arrays that corresponds to the structure of the table. For example, to specify headers * for a two-column table you would set the header property to [['header1', 'header2']]. * * If you specify null for the headers property (or leaving the property empty when you construct a TableData object), the following results * occur when your code executes. * * - If you insert a new table, the default column headers for the table are created. * * - If you overwrite or update an existing table, the existing headers are not altered. */ headers: any[]; /** * Gets or sets the rows in the table. Returns an array of arrays that contains the data in the table. * Returns an empty array if there are no rows. * * @remarks * * To specify rows, you must specify an array of arrays that corresponds to the structure of the table. For example, to specify two rows of * string values in a two-column table you would set the rows property to [['a', 'b'], ['c', 'd']]. * * If you specify null for the rows property (or leave the property empty when you construct a TableData object), the following results occur * when your code executes. * * - If you insert a new table, a blank row will be inserted. * * - If you overwrite or update an existing table, the existing rows are not altered. */ rows: any[][]; } /** * Specifies enumerated values for the `cells` property in the cellFormat parameter of * {@link https://learn.microsoft.com/office/dev/add-ins/excel/excel-add-ins-tables#format-a-table | table formatting methods}. */ enum Table { /** * The entire table, including column headers, data, and totals (if any). */ All, /** * Only the data (no headers and totals). */ Data, /** * Only the header row. */ Headers } /** * Represents a bound text selection in the document. * * The TextBinding object inherits the `id` property, type property, getDataAsync method, and setDataAsync method from the {@link Office.Binding} * object. It does not implement any additional properties or methods of its own. */ interface TextBinding extends Binding { } /** * Specifies the project fields that are available as a parameter for the {@link Office.Document | Document}.getProjectFieldAsync method. * * @remarks * * A ProjectProjectFields constant can be used as a parameter of the {@link Office.Document | Document}.getProjectFieldAsync method. */ enum ProjectProjectFields { /** * The number of digits after the decimal for the currency. */ CurrencyDigits, /** * The currency symbol. */ CurrencySymbol, /** * The placement of the currency symbol: Not specified = -1; Before the value with no space ($0) = 0; After the value with no space (0$) = 1; * Before the value with a space ($ 0) = 2; After the value with a space (0 $) = 3. */ CurrencySymbolPosition, DurationUnits, /** * The GUID of the project. */ GUID, /** * The project finish date. */ Finish, /** * The project start date. */ Start, /** * Specifies whether the project is read-only. */ ReadOnly, /** * The project version. */ VERSION, /** * The work units of the project, such as days or hours. */ WorkUnits, /** * The Project Web App URL, for projects that are stored in Project Server. */ ProjectServerUrl, /** * The SharePoint URL, for projects that are synchronized with a SharePoint list. */ WSSUrl, /** * The name of the SharePoint list, for projects that are synchronized with a tasks list. */ WSSList } /** * Specifies the resource fields that are available as a parameter for the {@link Office.Document | Document}.getResourceFieldAsync method. * * @remarks * * A ProjectResourceFields constant can be used as a parameter of the {@link Office.Document | Document}.getResourceFieldAsync method. * * For more information about working with fields in Project, see * {@link https://support.microsoft.com/office/615a4563-1cc3-40f4-b66f-1b17e793a460 | Available fields} reference. In * Project Help, search for Available fields. */ enum ProjectResourceFields { /** * The accrual method that defines how a task accrues the cost of the resource: Accrues when the task starts = 1, * accrues when the task ends = 2, accrues as the task progresses (prorated) = 3. */ Accrual, /** * The calculated actual cost of the resource for assignments in the project. */ ActualCost, /** * The actual overtime cost for a resource. */ ActualOvertimeCost, /** * The actual overtime work for a resource, in minutes. */ ActualOvertimeWork, /** * The actual overtime work for the resource that has been protected (made read-only). */ ActualOvertimeWorkProtected, /** * The actual work that the resource has done on assignments in the project. */ ActualWork, /** * The actual work for the resource that has been protected (made read-only). */ ActualWorkProtected, /** * The name of the base calendar for the resource. */ BaseCalendar, /** * The budget cost for the baseline resource. */ Baseline10BudgetCost, /** * The budget work for the baseline resource, in hours. */ Baseline10BudgetWork, /** * The cost for the baseline resource. */ Baseline10Cost, /** * The work for the baseline resource, in minutes. */ Baseline10Work, /** * The budget cost for the baseline resource. */ Baseline1BudgetCost, /** * The budget work for the baseline resource, in hours. */ Baseline1BudgetWork, /** * The cost for the baseline resource. */ Baseline1Cost, /** * The work for the baseline resource, in minutes. */ Baseline1Work, /** * The budget cost for the baseline resource. */ Baseline2BudgetCost, /** * The budget work for the baseline resource, in hours. */ Baseline2BudgetWork, /** * The cost for the baseline resource. */ Baseline2Cost, /** * The work for the baseline resource, in minutes. */ Baseline2Work, /** * The budget cost for the baseline resource. */ Baseline3BudgetCost, /** * The budget work for the baseline resource, in hours. */ Baseline3BudgetWork, /** * The cost for the baseline resource. */ Baseline3Cost, /** * The work for the baseline resource, in minutes. */ Baseline3Work, /** * The budget cost for the baseline resource. */ Baseline4BudgetCost, /** * The budget work for the baseline resource, in hours. */ Baseline4BudgetWork, /** * The cost for the baseline resource. */ Baseline4Cost, /** * The work for the baseline resource, in minutes. */ Baseline4Work, /** * The budget cost for the baseline resource. */ Baseline5BudgetCost, /** * The budget work for the baseline resource, in hours. */ Baseline5BudgetWork, /** * The cost for the baseline resource. */ Baseline5Cost, /** * The work for the baseline resource, in minutes. */ Baseline5Work, /** * The budget cost for the baseline resource. */ Baseline6BudgetCost, /** * The budget work for the baseline resource, in hours. */ Baseline6BudgetWork, /** * The cost for the baseline resource. */ Baseline6Cost, /** * The work for the baseline resource, in minutes. */ Baseline6Work, /** * The budget cost for the baseline resource. */ Baseline7BudgetCost, /** * The budget work for the baseline resource, in hours. */ Baseline7BudgetWork, /** * The cost for the baseline resource. */ Baseline7Cost, /** * The work for the baseline resource, in minutes. */ Baseline7Work, /** * The budget cost for the baseline resource. */ Baseline8BudgetCost, /** * The budget work for the baseline resource, in hours. */ Baseline8BudgetWork, /** * The cost for the baseline resource. */ Baseline8Cost, /** * The work for the baseline resource, in minutes. */ Baseline8Work, /** * The budget cost for the baseline resource. */ Baseline9BudgetCost, /** * The budget work for the baseline resource, in hours. */ Baseline9BudgetWork, /** * The cost for the baseline resource. */ Baseline9Cost, /** * The work for the baseline resource, in minutes. */ Baseline9Work, /** * The budget cost for the baseline resource. */ BaselineBudgetCost, /** * The budget work for the baseline resource, in hours. */ BaselineBudgetWork, /** * The baseline cost for the resource for assignments in the project. */ BaselineCost, /** * The baseline work for the resource for assignments in the project, in minutes. */ BaselineWork, /** * The budget cost for the resource. */ BudgetCost, /** * The budget work for the resource. */ BudgetWork, /** * The GUID of the resource calendar. */ ResourceCalendarGUID, /** * The code value of the resource. */ Code, /** * A cost field for the resource. */ Cost1, /** * A cost field for the resource. */ Cost10, /** * A cost field for the resource. */ Cost2, /** * A cost field for the resource. */ Cost3, /** * A cost field for the resource. */ Cost4, /** * A cost field for the resource. */ Cost5, /** * A cost field for the resource. */ Cost6, /** * A cost field for the resource. */ Cost7, /** * A cost field for the resource. */ Cost8, /** * A cost field for the resource. */ Cost9, /** * The date the resource was created. */ ResourceCreationDate, /** * A date field for the resource. */ Date1, /** * A date field for the resource. */ Date10, /** * A date field for the resource. */ Date2, /** * A date field for the resource. */ Date3, /** * A date field for the resource. */ Date4, /** * A date field for the resource. */ Date5, /** * A date field for the resource. */ Date6, /** * A date field for the resource. */ Date7, /** * A date field for the resource. */ Date8, /** * A date field for the resource. */ Date9, /** * A duration field for the resource. */ Duration1, /** * A duration field for the resource. */ Duration10, /** * A duration field for the resource. */ Duration2, /** * A duration field for the resource. */ Duration3, /** * A duration field for the resource. */ Duration4, /** * A duration field for the resource. */ Duration5, /** * A duration field for the resource. */ Duration6, /** * A duration field for the resource. */ Duration7, /** * A duration field for the resource. */ Duration8, /** * A duration field for the resource. */ Duration9, /** * The email address of the resource. */ Email, /** * The end date of the resource availability. */ End, /** * A finish field for the task. */ Finish1, /** * A finish field for the task. */ Finish10, /** * A finish field for the task. */ Finish2, /** * A finish field for the task. */ Finish3, /** * A finish field for the task. */ Finish4, /** * A finish field for the task. */ Finish5, /** * A finish field for the task. */ Finish6, /** * A finish field for the task. */ Finish7, /** * A finish field for the task. */ Finish8, /** * A finish field for the task. */ Finish9, /** * A Boolean flag field for the resource. */ Flag10, /** * A Boolean flag field for the resource. */ Flag1, /** * A Boolean flag field for the resource. */ Flag11, /** * A Boolean flag field for the resource. */ Flag12, /** * A Boolean flag field for the resource. */ Flag13, /** * A Boolean flag field for the resource. */ Flag14, /** * A Boolean flag field for the resource. */ Flag15, /** * A Boolean flag field for the resource. */ Flag16, /** * A Boolean flag field for the resource. */ Flag17, /** * A Boolean flag field for the resource. */ Flag18, /** * A Boolean flag field for the resource. */ Flag19, /** * A Boolean flag field for the resource. */ Flag2, /** * A Boolean flag field for the resource. */ Flag20, /** * A Boolean flag field for the resource. */ Flag3, /** * A Boolean flag field for the resource. */ Flag4, /** * A Boolean flag field for the resource. */ Flag5, /** * A Boolean flag field for the resource. */ Flag6, /** * A Boolean flag field for the resource. */ Flag7, /** * A Boolean flag field for the resource. */ Flag8, /** * A Boolean flag field for the resource. */ Flag9, /** * The group the resource belongs to. */ Group, /** * The percentage of work units that the resource has assigned in the project. If the resource is working full-time on the project, Units = 100. */ Units, /** * The name of the resource. */ Name, /** * The text value of the notes regarding the resource. */ Notes, /** * A number field for the resource. */ Number1, /** * A number field for the resource. */ Number10, /** * A number field for the resource. */ Number11, /** * A number field for the resource. */ Number12, /** * A number field for the resource. */ Number13, /** * A number field for the resource. */ Number14, /** * A number field for the resource. */ Number15, /** * A number field for the resource. */ Number16, /** * A number field for the resource. */ Number17, /** * A number field for the resource. */ Number18, /** * A number field for the resource. */ Number19, /** * A number field for the resource. */ Number2, /** * A number field for the resource. */ Number20, /** * A number field for the resource. */ Number3, /** * A number field for the resource. */ Number4, /** * A number field for the resource. */ Number5, /** * A number field for the resource. */ Number6, /** * A number field for the resource. */ Number7, /** * A number field for the resource. */ Number8, /** * A number field for the resource. */ Number9, /** * The overtime cost for a resource. */ OvertimeCost, /** * The overtime rate for a resource. */ OvertimeRate, /** * The overtime work for a resource. */ OvertimeWork, /** * The percentage of work complete for a resource. */ PercentWorkComplete, /** * The cost per use of the resource. */ CostPerUse, /** * Indicates whether the resource is a generic resource (identified by skill rather than by name). */ Generic, /** * Indicates whether the resource is overallocated. */ OverAllocated, /** * The amount of regular work for the resource. */ RegularWork, /** * The remaining cost for the resource. */ RemainingCost, /** * The remaining overtime cost for the resource. */ RemainingOvertimeCost, /** * The remaining overtime work for the resource, in minutes. */ RemainingOvertimeWork, /** * The remaining work for the resource, in minutes. */ RemainingWork, /** * The ID of the resource. */ ResourceGUID, /** * The total cost of the resource. */ Cost, /** * The total work for the resource, in minutes. */ Work, /** * The start date for the resource. */ Start, /** * A start field for the resource. */ Start1, /** * A start field for the resource. */ Start10, /** * A start field for the resource. */ Start2, /** * A start field for the resource. */ Start3, /** * A start field for the resource. */ Start4, /** * A start field for the resource. */ Start5, /** * A start field for the resource. */ Start6, /** * A start field for the resource. */ Start7, /** * A start field for the resource. */ Start8, /** * A start field for the resource. */ Start9, /** * The standard rate of pay for the resource, in cost per hour. */ StandardRate, /** * A text field for the resource. */ Text1, /** * A text field for the resource. */ Text10, /** * A text field for the resource. */ Text11, /** * A text field for the resource. */ Text12, /** * A text field for the resource. */ Text13, /** * A text field for the resource. */ Text14, /** * A text field for the resource. */ Text15, /** * A text field for the resource. */ Text16, /** * A text field for the resource. */ Text17, /** * A text field for the resource. */ Text18, /** * A text field for the resource. */ Text19, /** * A text field for the resource. */ Text2, /** * A text field for the resource. */ Text20, /** * A text field for the resource. */ Text21, /** * A text field for the resource. */ Text22, /** * A text field for the resource. */ Text23, /** * A text field for the resource. */ Text24, /** * A text field for the resource. */ Text25, /** * A text field for the resource. */ Text26, /** * A text field for the resource. */ Text27, /** * A text field for the resource. */ Text28, /** * A text field for the resource. */ Text29, /** * A text field for the resource. */ Text3, /** * A text field for the resource. */ Text30, /** * A text field for the resource. */ Text4, /** * A text field for the resource. */ Text5, /** * A text field for the resource. */ Text6, /** * A text field for the resource. */ Text7, /** * A text field for the resource. */ Text8, /** * A text field for the resource. */ Text9 } /** * Specifies the task fields that are available as a parameter for the {@link Office.Document | Document}.getTaskFieldAsync method. * * @remarks * * A ProjectTaskFields constant can be used as a parameter of the {@link Office.Document | Document}.getTaskFieldAsync method. * * For more information about working with fields in Project, see the * {@link https://support.microsoft.com/office/615a4563-1cc3-40f4-b66f-1b17e793a460 | Available fields} reference. * In Project Help, search for Available fields. */ enum ProjectTaskFields { /** * The current actual cost for the task. */ ActualCost, /** * The actual duration of the task, in minutes. */ ActualDuration, /** * The actual finish date of the task. */ ActualFinish, /** * The actual overtime cost for the task. */ ActualOvertimeCost, /** * The actual overtime work for the task, in minutes. */ ActualOvertimeWork, /** * The actual start date of the task. */ ActualStart, /** * The actual work for the task, in minutes. */ ActualWork, /** * A text field for the task. */ Text1, /** * A text field for the task. */ Text10, /** * A finish field for the task. */ Finish10, /** * A start field for the task. */ Start10, /** * A text field for the task. */ Text11, /** * A text field for the task. */ Text12, /** * A text field for the task. */ Text13, /** * A text field for the task. */ Text14, /** * A text field for the task. */ Text15, /** * A text field for the task. */ Text16, /** * A text field for the task. */ Text17, /** * A text field for the task. */ Text18, /** * A text field for the task. */ Text19, /** * A finish field for the task. */ Finish1, /** * A start field for the task. */ Start1, /** * A text field for the task. */ Text2, /** * A text field for the task. */ Text20, /** * A text field for the task. */ Text21, /** * A text field for the task. */ Text22, /** * A text field for the task. */ Text23, /** * A text field for the task. */ Text24, /** * A text field for the task. */ Text25, /** * A text field for the task. */ Text26, /** * A text field for the task. */ Text27, /** * A text field for the task. */ Text28, /** * A text field for the task. */ Text29, /** * A finish field for the task. */ Finish2, /** * A start field for the task. */ Start2, /** * A text field for the task. */ Text3, /** * A text field for the task. */ Text30, /** * A finish field for the task. */ Finish3, /** * A start field for the task. */ Start3, /** * A text field for the task. */ Text4, /** * A finish field for the task. */ Finish4, /** * A start field for the task. */ Start4, /** * A text field for the task. */ Text5, /** * A finish field for the task. */ Finish5, /** * A start field for the task. */ Start5, /** * A text field for the task. */ Text6, /** * A finish field for the task. */ Finish6, /** * A start field for the task. */ Start6, /** * A text field for the task. */ Text7, /** * A finish field for the task. */ Finish7, /** * A start field for the task. */ Start7, /** * A text field for the task. */ Text8, /** * A finish field for the task. */ Finish8, /** * A start field for the task. */ Start8, /** * A text field for the task. */ Text9, /** * A finish field for the task. */ Finish9, /** * A start field for the task. */ Start9, /** * The budget cost for the baseline task. */ Baseline10BudgetCost, /** * The budget work for the baseline task, in hours. */ Baseline10BudgetWork, /** * The cost for the baseline task. */ Baseline10Cost, /** * The duration for the baseline task, in minutes. */ Baseline10Duration, /** * The finish date for the baseline task. */ Baseline10Finish, /** * The fixed cost of any non-resource expense for the baseline task. */ Baseline10FixedCost, /** * The accrual method that defines how the baseline task accrues fixed costs: Accrues when the task starts = 1, * accrues when the task ends = 2, accrues as the task progresses (prorated) = 3. */ Baseline10FixedCostAccrual, /** * The start date for the baseline task. */ Baseline10Start, /** * The total person-hours scheduled for the baseline task, in minutes. */ Baseline10Work, /** * The budget cost for the baseline task. */ Baseline1BudgetCost, /** * The budget work for the baseline task, in hours. */ Baseline1BudgetWork, /** * The cost for the baseline task. */ Baseline1Cost, /** * The duration for the baseline task, in minutes. */ Baseline1Duration, /** * The finish date for the baseline task. */ Baseline1Finish, /** * The fixed cost of any non-resource expense for the baseline task. */ Baseline1FixedCost, /** * The accrual method that defines how the baseline task accrues fixed costs: Accrues when the task starts = 1, * accrues when the task ends = 2, accrues as the task progresses (prorated) = 3. */ Baseline1FixedCostAccrual, /** * The start date for the baseline task. */ Baseline1Start, /** * The total person-hours scheduled for the baseline task, in minutes. */ Baseline1Work, /** * The budget cost for the baseline task. */ Baseline2BudgetCost, /** * The budget work for the baseline task, in hours. */ Baseline2BudgetWork, /** * The cost for the baseline task. */ Baseline2Cost, /** * The duration for the baseline task, in minutes. */ Baseline2Duration, /** * The finish date for the baseline task. */ Baseline2Finish, /** * The fixed cost of any non-resource expense for the baseline task. */ Baseline2FixedCost, /** * The accrual method that defines how the baseline task accrues fixed costs: Accrues when the task starts = 1, * accrues when the task ends = 2, accrues as the task progresses (prorated) = 3. */ Baseline2FixedCostAccrual, /** * The start date for the baseline task. */ Baseline2Start, /** * The total person-hours scheduled for the baseline task, in minutes. */ Baseline2Work, /** * The budget cost for the baseline task. */ Baseline3BudgetCost, /** * The budget work for the baseline task, in hours. */ Baseline3BudgetWork, /** * The cost for the baseline task. */ Baseline3Cost, /** * The duration for the baseline task, in minutes. */ Baseline3Duration, /** * The finish date for the baseline task. */ Baseline3Finish, /** * The fixed cost of any non-resource expense for the baseline task. */ Baseline3FixedCost, /** * The accrual method that defines how the baseline task accrues fixed costs: Accrues when the task starts = 1, * accrues when the task ends = 2, accrues as the task progresses (prorated) = 3. */ Baseline3FixedCostAccrual, /** * The start date for the baseline task. */ Baseline3Start, /** * The total person-hours scheduled for the baseline task, in minutes. */ Baseline3Work, /** * The budget cost for the baseline task. */ Baseline4BudgetCost, /** * The budget work for the baseline task, in hours. */ Baseline4BudgetWork, /** * The cost for the baseline task. */ Baseline4Cost, /** * The duration for the baseline task, in minutes. */ Baseline4Duration, /** * The finish date for the baseline task. */ Baseline4Finish, /** * The fixed cost of any non-resource expense for the baseline task. */ Baseline4FixedCost, /** * The accrual method that defines how the baseline task accrues fixed costs: Accrues when the task starts = 1, * accrues when the task ends = 2, accrues as the task progresses (prorated) = 3. */ Baseline4FixedCostAccrual, /** * The start date for the baseline task. */ Baseline4Start, /** * The total person-hours scheduled for the baseline task, in minutes. */ Baseline4Work, /** * The budget cost for the baseline task. */ Baseline5BudgetCost, /** * The budget work for the baseline task, in hours. */ Baseline5BudgetWork, /** * The cost for the baseline task. */ Baseline5Cost, /** * The duration for the baseline task, in minutes. */ Baseline5Duration, /** * The finish date for the baseline task. */ Baseline5Finish, /** * The fixed cost of any non-resource expense for the baseline task. */ Baseline5FixedCost, /** * The accrual method that defines how the baseline task accrues fixed costs: Accrues when the task starts = 1, * accrues when the task ends = 2, accrues as the task progresses (prorated) = 3. */ Baseline5FixedCostAccrual, /** * The start date for the baseline task. */ Baseline5Start, /** * The total person-hours scheduled for the baseline task, in minutes. */ Baseline5Work, /** * The budget cost for the baseline task. */ Baseline6BudgetCost, /** * The budget work for the baseline task, in hours. */ Baseline6BudgetWork, /** * The cost for the baseline task. */ Baseline6Cost, /** * The duration for the baseline task, in minutes. */ Baseline6Duration, /** * The finish date for the baseline task. */ Baseline6Finish, /** * The fixed cost of any non-resource expense for the baseline task. */ Baseline6FixedCost, /** * The accrual method that defines how the baseline task accrues fixed costs: Accrues when the task starts = 1, * accrues when the task ends = 2, accrues as the task progresses (prorated) = 3. */ Baseline6FixedCostAccrual, /** * The start date for the baseline task. */ Baseline6Start, /** * The total person-hours scheduled for the baseline task, in minutes. */ Baseline6Work, /** * The budget cost for the baseline task. */ Baseline7BudgetCost, /** * The budget work for the baseline task, in hours. */ Baseline7BudgetWork, /** * The cost for the baseline task. */ Baseline7Cost, /** * The duration for the baseline task, in minutes. */ Baseline7Duration, /** * The finish date for the baseline task. */ Baseline7Finish, /** * The fixed cost of any non-resource expense for the baseline task. */ Baseline7FixedCost, /** * The accrual method that defines how the baseline task accrues fixed costs: Accrues when the task starts = 1, * accrues when the task ends = 2, accrues as the task progresses (prorated) = 3. */ Baseline7FixedCostAccrual, /** * The start date for the baseline task. */ Baseline7Start, /** * The total person-hours scheduled for the baseline task, in minutes. */ Baseline7Work, /** * The budget cost for the baseline task. */ Baseline8BudgetCost, /** * The budget work for the baseline task, in hours. */ Baseline8BudgetWork, /** * The cost for the baseline task. */ Baseline8Cost, /** * The duration for the baseline task, in minutes. */ Baseline8Duration, /** * The finish date for the baseline task. */ Baseline8Finish, /** * The fixed cost of any non-resource expense for the baseline task. */ Baseline8FixedCost, /** * The accrual method that defines how the baseline task accrues fixed costs: Accrues when the task starts = 1, * accrues when the task ends = 2, accrues as the task progresses (prorated) = 3. */ Baseline8FixedCostAccrual, /** * The start date for the baseline task. */ Baseline8Start, /** * The total person-hours scheduled for the baseline task, in minutes. */ Baseline8Work, /** * The budget cost for the baseline task. */ Baseline9BudgetCost, /** * The budget work for the baseline task, in hours. */ Baseline9BudgetWork, /** * The cost for the baseline task. */ Baseline9Cost, /** * The duration for the baseline task, in minutes. */ Baseline9Duration, /** * The finish date for the baseline task. */ Baseline9Finish, /** * The fixed cost of any non-resource expense for the baseline task. */ Baseline9FixedCost, /** * The accrual method that defines how the baseline task accrues fixed costs: Accrues when the task starts = 1, * accrues when the task ends = 2, accrues as the task progresses (prorated) = 3. */ Baseline9FixedCostAccrual, /** * The start date for the baseline task. */ Baseline9Start, /** * The total person-hours scheduled for the baseline task, in minutes. */ Baseline9Work, /** * The budget cost for the baseline task. */ BaselineBudgetCost, /** * The budget work for the baseline task, in hours. */ BaselineBudgetWork, /** * The cost for the baseline task. */ BaselineCost, /** * The duration for the baseline task, in minutes. */ BaselineDuration, /** * The finish date for the baseline task. */ BaselineFinish, /** * The fixed cost of any non-resource expense for the baseline task. */ BaselineFixedCost, /** * The accrual method that defines how the baseline task accrues fixed costs: Accrues when the task starts = 1, * accrues when the task ends = 2, accrues as the task progresses (prorated) = 3. */ BaselineFixedCostAccrual, /** * The start date for the baseline task. */ BaselineStart, /** * The total person-hours scheduled for the baseline task, in minutes. */ BaselineWork, /** * The budget cost for the task. */ BudgetCost, BudgetFixedCost, BudgetFixedWork, /** * The budget work for the task, in hours. */ BudgetWork, /** * The GUID of the task calendar. */ TaskCalendarGUID, /** * A constraint date for the task. */ ConstraintDate, /** * A constraint type for the task: As Soon As Possible = 0, As Late As Possible = 1, Must Start On = 2, Must Finish On = 3, * Start No Earlier Than = 4, Start No Later Than = 5, Finish No Earlier Than = 6, Finish No Later Than = 7. */ ConstraintType, /** * A cost field of the task. */ Cost1, /** * A cost field of the task. */ Cost10, /** * A cost field of the task. */ Cost2, /** * A cost field of the task. */ Cost3, /** * A cost field of the task. */ Cost4, /** * A cost field of the task. */ Cost5, /** * A cost field of the task. */ Cost6, /** * A cost field of the task. */ Cost7, /** * A cost field of the task. */ Cost8, /** * A cost field of the task. */ Cost9, /** * A date field of the task. */ Date1, /** * A date field of the task. */ Date10, /** * A date field of the task. */ Date2, /** * A date field of the task. */ Date3, /** * A date field of the task. */ Date4, /** * A date field of the task. */ Date5, /** * A date field of the task. */ Date6, /** * A date field of the task. */ Date7, /** * A date field of the task. */ Date8, /** * A date field of the task. */ Date9, /** * The deadline for a task. */ Deadline, /** * A duration field of the task. */ Duration1, /** * A duration field of the task. */ Duration10, /** * A duration field of the task. */ Duration2, /** * A duration field of the task. */ Duration3, /** * A duration field of the task. */ Duration4, /** * A duration field of the task. */ Duration5, /** * A duration field of the task. */ Duration6, /** * A duration field of the task. */ Duration7, /** * A duration field of the task. */ Duration8, /** * A duration field of the task. */ Duration9, /** * A duration field of the task. */ Duration, /** * The method for calculating earned value for the task. */ EarnedValueMethod, /** * The duration between the Early Finish and Late Finish dates for the task, in minutes. */ FinishSlack, /** * The fixed cost for the task. */ FixedCost, /** * The accrual method that defines how the baseline task accrues fixed costs: Accrues when the task starts = 1, * accrues when the task ends = 2, accrues as the task progresses (prorated) = 3. */ FixedCostAccrual, /** * A Boolean flag field for the task. */ Flag10, /** * A Boolean flag field for the task. */ Flag1, /** * A Boolean flag field for the task. */ Flag11, /** * A Boolean flag field for the task. */ Flag12, /** * A Boolean flag field for the task. */ Flag13, /** * A Boolean flag field for the task. */ Flag14, /** * A Boolean flag field for the task. */ Flag15, /** * A Boolean flag field for the task. */ Flag16, /** * A Boolean flag field for the task. */ Flag17, /** * A Boolean flag field for the task. */ Flag18, /** * A Boolean flag field for the task. */ Flag19, /** * A Boolean flag field for the task. */ Flag2, /** * A Boolean flag field for the task. */ Flag20, /** * A Boolean flag field for the task. */ Flag3, /** * A Boolean flag field for the task. */ Flag4, /** * A Boolean flag field for the task. */ Flag5, /** * A Boolean flag field for the task. */ Flag6, /** * A Boolean flag field for the task. */ Flag7, /** * A Boolean flag field for the task. */ Flag8, /** * A Boolean flag field for the task. */ Flag9, /** * The amount of time that the task can be delayed without delaying its successor tasks. */ FreeSlack, /** * Indicates whether the task has rollup subtasks. */ HasRollupSubTasks, /** * The index of the selected task. After the project summary task, the index of the first task in a project is 1. */ ID, /** * The name of the task. */ Name, /** * The text value of the notes regarding the task. */ Notes, /** * A number field for the task. */ Number1, /** * A number field for the task. */ Number10, /** * A number field for the task. */ Number11, /** * A number field for the task. */ Number12, /** * A number field for the task. */ Number13, /** * A number field for the task. */ Number14, /** * A number field for the task. */ Number15, /** * A number field for the task. */ Number16, /** * A number field for the task. */ Number17, /** * A number field for the task. */ Number18, /** * A number field for the task. */ Number19, /** * A number field for the task. */ Number2, /** * A number field for the task. */ Number20, /** * A number field for the task. */ Number3, /** * A number field for the task. */ Number4, /** * A number field for the task. */ Number5, /** * A number field for the task. */ Number6, /** * A number field for the task. */ Number7, /** * A number field for the task. */ Number8, /** * A number field for the task. */ Number9, /** * The scheduled (as opposed to actual) duration of the task. */ ScheduledDuration, /** * The scheduled (as opposed to actual) finish date of the task. */ ScheduledFinish, /** * The scheduled (as opposed to actual) start date of the task. */ ScheduledStart, /** * The level of the task in the outline hierarchy. */ OutlineLevel, /** * The overtime cost for the task. */ OvertimeCost, /** * The overtime work for the task. */ OvertimeWork, /** * The percent complete status of the task. */ PercentComplete, /** * The percentage of work completed for the task. */ PercentWorkComplete, /** * The IDs of the task's predecessors. */ Predecessors, /** * The finish date of a task before leveling occurred. */ PreleveledFinish, /** * The start date of a task before leveling occurred. */ PreleveledStart, /** * The priority of the task, with values from 0 (low) to 1000 (high). The default priority value is 500. */ Priority, /** * Indicates whether the task is active. */ Active, /** * Indicates whether the task is on the critical path. */ Critical, /** * Indicates whether the task is a milestone. */ Milestone, /** * Indicates whether any assignments for a task are overallocated. */ Overallocated, /** * Indicates whether subtask information is rolled up to the summary task bar. */ IsRollup, /** * Indicates whether the task is a summary task. */ Summary, /** * The amount of regular work for the task. */ RegularWork, /** * The remaining cost for the task. */ RemainingCost, /** * The remaining duration for the task, in minutes. */ RemainingDuration, /** * The remaining overtime cost for the task. */ RemainingOvertimeCost, /** * The remaining work for the task, in minutes. */ RemainingWork, /** * The names of the resources assigned to a task. */ ResourceNames, /** * The total cost of the task. */ Cost, /** * The finish date of the task. */ Finish, /** * The start date of the task. */ Start, /** * The total person-hours scheduled for the task, in minutes. */ Work, /** * The duration between the Early Start and Late Start dates for the task. */ StartSlack, /** * The status of the task: Complete = 0, on schedule = 1, late = 2, future task = 3, status not available = 4. */ Status, /** * The IDs of the task's successors. */ Successors, /** * The enterprise resource responsible for accepting or rejecting assignment progress updates for the task. */ StatusManager, /** * The total slack time for the task, in minutes. */ TotalSlack, /** * The GUID of the task. */ TaskGUID, /** * The way the task is calculated: Fixed units = 0, fixed duration = 1, fixed work = 2. */ Type, /** * The work breakdown structure code of the task. */ WBS, /** * The work breakdown structure codes of the task predecessors, separated by the list separator. */ WBSPREDECESSORS, /** * The work breakdown structure codes of the task successors, separated by the list separator. */ WBSSUCCESSORS, /** * The ID of the task in a SharePoint list, for a project that is synchronized with a SharePoint tasks list. */ WSSID } /** * Specifies the types of views that the {@link Office.Document | Document}.getSelectedViewAsync method can recognize. * * @remarks * * The {@link Office.Document | Document}.getSelectedViewAsync method returns the ProjectViewTypes constant value and name that corresponds to the * active view. */ enum ProjectViewTypes { /** * The Gantt chart view. */ Gantt, /** * The Network Diagram view. */ NetworkDiagram, /** * The Task Diagram view. */ TaskDiagram, /** * The Task form view. */ TaskForm, /** * The Task Sheet view. */ TaskSheet, /** * The Resource Form view. */ ResourceForm, /** * The Resource Sheet view. */ ResourceSheet, /** * The Resource Graph view. */ ResourceGraph, /** * The Team Planner view. */ TeamPlanner, /** * The Task Details view. */ TaskDetails, /** * The Task Name Form view. */ TaskNameForm, /** * The Resource Names view. */ ResourceNames, /** * The Calendar view. */ Calendar, /** * The Task Usage view. */ TaskUsage, /** * The Resource Usage view. */ ResourceUsage, /** * The Timeline view. */ Timeline } } //////////////////////////////////////////////////////////////// ///////////////////// End Office namespace ///////////////////// //////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////// ////////////////////// Begin Exchange APIs ///////////////////// //////////////////////////////////////////////////////////////// declare namespace Office { namespace MailboxEnums { /** * Specifies the type of custom action in a notification message. * * @remarks * [Api set: Mailbox 1.10] */ enum ActionType { /** * The `showTaskPane` action. */ ShowTaskPane = "showTaskPane" } /** * Specifies the {@link Office.Sensitivity | sensitivity level} of an appointment. * * @remarks * [Api set: Mailbox preview] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose or Read * * @beta */ enum AppointmentSensitivityType { /** * The item needs no special treatment. * * @remarks * [Api set: Mailbox preview] */ Normal = "normal", /** * Treat the item as personal. * * @remarks * [Api set: Mailbox preview] */ Personal = "personal", /** * Treat the item as private. * * @remarks * [Api set: Mailbox preview] */ Private = "private", /** * Treat the item as confidential. * * @remarks * [Api set: Mailbox preview] */ Confidential = "confidential" } /** * Specifies the formatting that applies to an attachment's content. * * @remarks * [Api set: Mailbox 1.8] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose or Read */ enum AttachmentContentFormat { /** * The content of the attachment is returned as a base64-encoded string. */ Base64 = "base64", /** * The content of the attachment is returned as a string representing a URL. */ Url = "url", /** * The content of the attachment is returned as a string representing an .eml formatted file. */ Eml = "eml", /** * The content of the attachment is returned as a string representing an .icalendar formatted file. */ ICalendar = "iCalendar" } /** * Specifies whether an attachment was added to or removed from an item. * * @remarks * [Api set: Mailbox 1.8] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose or Read */ enum AttachmentStatus { /** * An attachment was added to the item. */ Added = "added", /** * An attachment was removed from the item. */ Removed = "removed" } /** * Specifies an attachment's type. * * @remarks * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose or Read */ enum AttachmentType { /** * The attachment is a file. */ File = "file", /** * The attachment is an Exchange item. */ Item = "item", /** * The attachment is stored in a cloud location, such as OneDrive. * * **Important**: In Read mode, the `id` property of the attachment's {@link Office.AttachmentDetails | details} object * contains a URL to the file. * From requirement set 1.8, the `url` property included in the attachment's {@link Office.AttachmentDetailsCompose | details} object * contains a URL to the file in Compose mode. */ Cloud = "cloud" } /** * Specifies the category color. * * @remarks * [Api set: Mailbox 1.8] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose or Read * * **Important**: The actual color depends on how the Outlook client renders it. * In this case, the colors noted on each preset apply to Outlook on Windows, on the web, * and on Mac (starting in Version 16.78). */ enum CategoryColor { /** * Default color or no color mapped. */ None, /** * Red */ Preset0, /** * Orange */ Preset1, /** * Brown */ Preset2, /** * Yellow */ Preset3, /** * Green */ Preset4, /** * Teal */ Preset5, /** * Olive */ Preset6, /** * Blue */ Preset7, /** * Purple */ Preset8, /** * Cranberry */ Preset9, /** * Steel */ Preset10, /** * DarkSteel */ Preset11, /** * Gray */ Preset12, /** * DarkGray */ Preset13, /** * Black */ Preset14, /** * DarkRed */ Preset15, /** * DarkOrange */ Preset16, /** * DarkBrown */ Preset17, /** * DarkYellow */ Preset18, /** * DarkGreen */ Preset19, /** * DarkTeal */ Preset20, /** * DarkOlive */ Preset21, /** * DarkBlue */ Preset22, /** * DarkPurple */ Preset23, /** * DarkCranberry */ Preset24 } /** * Specifies a message's compose type. * * @remarks * [Api set: Mailbox 1.10] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose */ enum ComposeType { /** * Reply. */ Reply = "reply", /** * New mail. */ NewMail = "newMail", /** * Forward. */ Forward = "forward" } /** * Specifies the day of week or type of day. * * @remarks * [Api set: Mailbox 1.7] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose or Read */ enum Days { /** * Monday */ Mon = "mon", /** * Tuesday */ Tue = "tue", /** * Wednesday */ Wed = "wed", /** * Thursday */ Thu = "thu", /** * Friday */ Fri = "fri", /** * Saturday */ Sat = "sat", /** * Sunday */ Sun = "sun", /** * Week day (excludes weekend days): 'Mon', 'Tue', 'Wed', 'Thu', and 'Fri'. */ Weekday = "weekday", /** * Weekend day: 'Sat' and 'Sun'. */ WeekendDay = "weekendDay", /** * Day of week. */ Day = "day" } /** * This bitmask represents a delegate's permissions on a shared folder, or a user's permissions on a shared mailbox. * * @remarks * [Api set: Mailbox 1.8] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose or Read */ enum DelegatePermissions { /** * Delegate or user has permission to read items. */ Read = 1, /** * Delegate or user has permission to create and write items. */ Write = 2, /** * Delegate or user has permission to delete only the items they created. */ DeleteOwn = 4, /** * Delegate or user has permission to delete any items. */ DeleteAll = 8, /** * Delegate or user has permission to edit only they items they created. */ EditOwn = 16, /** * Delegate or user has permission to edit any items. */ EditAll = 32 } /** * Specifies an entity's type. * * @remarks * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose or Read */ enum EntityType { /** * Specifies that the entity is a meeting suggestion. */ MeetingSuggestion = "meetingSuggestion", /** * Specifies that the entity is a task suggestion. */ TaskSuggestion = "taskSuggestion", /** * Specifies that the entity is a postal address. */ Address = "address", /** * Specifies that the entity is an SMTP email address. */ EmailAddress = "emailAddress", /** * Specifies that the entity is an Internet URL. */ Url = "url", /** * Specifies that the entity is a US phone number. */ PhoneNumber = "phoneNumber", /** * Specifies that the entity is a contact. */ Contact = "contact" } /** * Action types supported by {@link https://learn.microsoft.com/javascript/api/office/office.eventtype | Office.EventType.InfobarClicked}. * * @remarks * [Api set: Mailbox 1.10] */ enum InfobarActionType { /** * Dismiss action was selected. * * @remarks * [Api set: Mailbox 1.10] */ Dismiss = 1 } /** * Type of notification allowed by {@link https://learn.microsoft.com/javascript/api/office/office.eventtype | Office.EventType.InfobarClicked}. * * @remarks * [Api set: Mailbox 1.10] */ enum InfobarType { /** * Notification displays an informational message. * * @remarks * [Api set: Mailbox 1.10] */ Informational = 0, /** * Notification displays a progress indicator. * * @remarks * [Api set: Mailbox 1.10] */ ProgressIndicator = 1, /** * Notification displays an error message. * * @remarks * [Api set: Mailbox 1.10] */ Error = 2, /** * Notification displays an informational message with actions. * * @remarks * [Api set: Mailbox 1.10] */ Insight = 3 } /** * Specifies the notification message type for an appointment or message. * * @remarks * [Api set: Mailbox 1.3] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose or Read */ enum ItemNotificationMessageType { /** * The notification message is a progress indicator. */ ProgressIndicator = "progressIndicator", /** * The notification message is an informational message. */ InformationalMessage = "informationalMessage", /** * The notification message is an error message. * * **Important**: Only the `InformationalMessage` type is supported in Outlook on Android and on iOS. */ ErrorMessage = "errorMessage", /** * The notification message is an informational message with actions. * * @remarks * [Api set: Mailbox 1.10] */ InsightMessage = "insightMessage" } /** * Specifies an item's type. * * @remarks * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose or Read */ enum ItemType { /** * An email, meeting request, meeting response, or meeting cancellation. */ Message = "message", /** * An appointment item. */ Appointment = "appointment" } /** * Specifies an appointment location's type. * * @remarks * [Api set: Mailbox 1.8] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose or Read */ enum LocationType { /** * A custom location. Custom locations don't have an SMTP address. * * **Note**: {@link https://support.microsoft.com/office/88ff6c60-0a1d-4b54-8c9d-9e1a71bc3023 | Personal contact groups} * added as appointment locations aren't returned by the * {@link https://learn.microsoft.com/javascript/api/outlook/office.enhancedlocation#outlook-office-enhancedlocation-getasync-member(1) | EnhancedLocation.getAsync} method. */ Custom = "custom", /** * A conference room or similar resource that has an SMTP address. */ Room = "room" } /** * Specifies the month. * * @remarks * [Api set: Mailbox 1.7] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose or Read */ enum Month { /** * January */ Jan = "jan", /** * February */ Feb = "feb", /** * March */ Mar = "mar", /** * April */ Apr = "apr", /** * May */ May = "may", /** * June */ Jun = "jun", /** * July */ Jul = "jul", /** * August */ Aug = "aug", /** * September */ Sep = "sep", /** * October */ Oct = "oct", /** * November */ Nov = "nov", /** * December */ Dec = "dec" } /** * Specifies the folder to which a reported spam or phishing message is moved once it's processed by a spam-reporting add-in. * * To learn more about the integrated spam-reporting feature, see * {@link https://learn.microsoft.com/office/dev/add-ins/outlook/spam-reporting | Implement an integrated spam-reporting add-in (preview)}. * * @remarks * [Api set: Mailbox preview] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Message Read * * **Important**: This enum can only be used to assign values to the * {@link https://learn.microsoft.com/javascript/api/outlook/office.spamreportingeventcompletedoptions?view=outlook-js-preview&preserve-view=true#outlook-office-spamreportingeventcompletedoptions-moveitemto-member | moveItemTo} * property of the {@link https://learn.microsoft.com/javascript/api/outlook/office.mailboxevent#outlook-office-mailboxevent-completed-member(1) | event.completed} * method. If you're on an Outlook on Windows version that only supports the `postProcessingAction` property, * you must assign it different string values. For a list of supported string values, see * {@link https://learn.microsoft.com/javascript/api/outlook/office.spamreportingeventcompletedoptions?view=outlook-js-preview&preserve-view=true#outlook-office-spamreportingeventcompletedoptions-postprocessingaction-member | * Office.SpamReportingEventCompletedOptions.postProcessingAction}. * * @beta */ enum MoveSpamItemTo { /** * Specifies that a reported message is moved to a custom folder in the mailbox. */ CustomFolder = "customFolder", /** * Specifies that a reported message is moved to the **Deleted Items** folder of the mailbox. */ DeletedItemsFolder = "deletedItemsFolder", /** * Specifies that a reported message is moved to the **Junk Email** folder of the mailbox. */ JunkFolder = "junkFolder", /** * Specifies that a reported message remains in its current folder in the mailbox. */ NoMove = "noMove" } /** * Represents the current view of Outlook on the web. */ enum OWAView { /** * Narrow one-column view. Displayed when the screen width is less than 436 pixels. * For example, Outlook on the web uses this view on the entire screen of older smartphones. */ OneColumnNarrow = "OneColumnNarrow", /** * One-column view. Displayed when the screen width is greater than or equal to 436 pixels, * but less than 536 pixels. For example, Outlook on the web uses this view on the entire screen of newer smartphones. */ OneColumn = "OneColumn", /** * Two-column view. Displayed when the screen width is greater than or equal to 536 pixels, * but less than 780 pixels. For example, Outlook on the web uses this view on most tablets. */ TwoColumns = "TwoColumns", /** * Three-column view. Displayed when the screen width is greater than or equal to 780 pixels. * For example, Outlook on the web uses this view in a full screen window on a desktop computer. */ ThreeColumns = "ThreeColumns" } /** * Specifies the type of recipient of a message or appointment. * * @remarks * [Api set: Mailbox 1.1] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose or Read * * **Important**: A `recipientType` property value isn't returned by the * {@link https://learn.microsoft.com/javascript/api/outlook/office.from?view=outlook-js-preview#outlook-office-from-getasync-member(1) | Office.context.mailbox.item.from.getAsync} * and {@link https://learn.microsoft.com/javascript/api/outlook/office.organizer?view=outlook-js-preview#outlook-office-organizer-getasync-member(1) | Office.context.mailbox.item.organizer.getAsync} methods. * The email sender or appointment organizer is always a user whose email address is on the Exchange server. */ enum RecipientType { /** * Specifies the recipient is a distribution list containing a list of email addresses. */ DistributionList = "distributionList", /** * Specifies the recipient is an SMTP email address on the Exchange server. */ User = "user", /** * Specifies the recipient is an SMTP email address that isn't on the Exchange server. It also refers to a recipient added from a personal Outlook address book. * * **Important**: In Outlook on Windows (starting with Version 2210 (Build 15813.20002)), on Mac, and on the web, Global Address Book (GAL) recipients saved to a personal address book return * the `ExternalUser` value, even if their SMTP email address appears on the Exchange server. Recipients return a `User` value only if they're directly * added or resolved against the GAL. */ ExternalUser = "externalUser", /** * Specifies the recipient isn't one of the other recipient types. It also refers to a recipient that isn't resolved against the Exchange address book, * and is therefore treated as an external SMTP address. * * **Important**: In Outlook on Android and on iOS, Global Address Book (GAL) recipients saved to a personal address book return * the `Other` value, even if their SMTP email address appears on the Exchange server. Recipients return a `User` value only if they're directly * added or resolved against the GAL. */ Other = "other" } /** * Specifies the time zone applied to the recurrence. * * @remarks * [Api set: Mailbox 1.7] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose or Read */ enum RecurrenceTimeZone { /** * Afghanistan Standard Time */ AfghanistanStandardTime = "Afghanistan Standard Time", /** * Alaskan Standard Time */ AlaskanStandardTime = "Alaskan Standard Time", /** * Aleutian Standard Time */ AleutianStandardTime = "Aleutian Standard Time", /** * Altai Standard Time */ AltaiStandardTime = "Altai Standard Time", /** * Arab Standard Time */ ArabStandardTime = "Arab Standard Time", /** * Arabian Standard Time */ ArabianStandardTime = "Arabian Standard Time", /** * Arabic Standard Time */ ArabicStandardTime = "Arabic Standard Time", /** * Argentina Standard Time */ ArgentinaStandardTime = "Argentina Standard Time", /** * Astrakhan Standard Time */ AstrakhanStandardTime = "Astrakhan Standard Time", /** * Atlantic Standard Time */ AtlanticStandardTime = "Atlantic Standard Time", /** * Australia Central Standard Time */ AUSCentralStandardTime = "AUS Central Standard Time", /** * Australia Central West Standard Time */ AusCentralW_StandardTime = "Aus Central W. Standard Time", /** * AUS Eastern Standard Time */ AUSEasternStandardTime = "AUS Eastern Standard Time", /** * Azerbaijan Standard Time */ AzerbaijanStandardTime = "Azerbaijan Standard Time", /** * Azores Standard Time */ AzoresStandardTime = "Azores Standard Time", /** * Bahia Standard Time */ BahiaStandardTime = "Bahia Standard Time", /** * Bangladesh Standard Time */ BangladeshStandardTime = "Bangladesh Standard Time", /** * Belarus Standard Time */ BelarusStandardTime = "Belarus Standard Time", /** * Bougainville Standard Time */ BougainvilleStandardTime = "Bougainville Standard Time", /** * Canada Central Standard Time */ CanadaCentralStandardTime = "Canada Central Standard Time", /** * Cape Verde Standard Time */ CapeVerdeStandardTime = "Cape Verde Standard Time", /** * Caucasus Standard Time */ CaucasusStandardTime = "Caucasus Standard Time", /** * Central Australia Standard Time */ CenAustraliaStandardTime = "Cen. Australia Standard Time", /** * Central America Standard Time */ CentralAmericaStandardTime = "Central America Standard Time", /** * Central Asia Standard Time */ CentralAsiaStandardTime = "Central Asia Standard Time", /** * Central Brazilian Standard Time */ CentralBrazilianStandardTime = "Central Brazilian Standard Time", /** * Central Europe Standard Time */ CentralEuropeStandardTime = "Central Europe Standard Time", /** * Central European Standard Time */ CentralEuropeanStandardTime = "Central European Standard Time", /** * Central Pacific Standard Time */ CentralPacificStandardTime = "Central Pacific Standard Time", /** * Central Standard Time */ CentralStandardTime = "Central Standard Time", /** * Central Standard Time (Mexico) */ CentralStandardTime_Mexico = "Central Standard Time (Mexico)", /** * Chatham Islands Standard Time */ ChathamIslandsStandardTime = "Chatham Islands Standard Time", /** * China Standard Time */ ChinaStandardTime = "China Standard Time", /** * Cuba Standard Time */ CubaStandardTime = "Cuba Standard Time", /** * Dateline Standard Time */ DatelineStandardTime = "Dateline Standard Time", /** * East Africa Standard Time */ E_AfricaStandardTime = "E. Africa Standard Time", /** * East Australia Standard Time */ E_AustraliaStandardTime = "E. Australia Standard Time", /** * East Europe Standard Time */ E_EuropeStandardTime = "E. Europe Standard Time", /** * East South America Standard Time */ E_SouthAmericaStandardTime = "E. South America Standard Time", /** * Easter Island Standard Time */ EasterIslandStandardTime = "Easter Island Standard Time", /** * Eastern Standard Time */ EasternStandardTime = "Eastern Standard Time", /** * Eastern Standard Time (Mexico) */ EasternStandardTime_Mexico = "Eastern Standard Time (Mexico)", /** * Egypt Standard Time */ EgyptStandardTime = "Egypt Standard Time", /** * Ekaterinburg Standard Time */ EkaterinburgStandardTime = "Ekaterinburg Standard Time", /** * Fiji Standard Time */ FijiStandardTime = "Fiji Standard Time", /** * FLE Standard Time */ FLEStandardTime = "FLE Standard Time", /** * Georgian Standard Time */ GeorgianStandardTime = "Georgian Standard Time", /** * GMT Standard Time */ GMTStandardTime = "GMT Standard Time", /** * Greenland Standard Time */ GreenlandStandardTime = "Greenland Standard Time", /** * Greenwich Standard Time */ GreenwichStandardTime = "Greenwich Standard Time", /** * GTB Standard Time */ GTBStandardTime = "GTB Standard Time", /** * Haiti Standard Time */ HaitiStandardTime = "Haiti Standard Time", /** * Hawaiian Standard Time */ HawaiianStandardTime = "Hawaiian Standard Time", /** * India Standard Time */ IndiaStandardTime = "India Standard Time", /** * Iran Standard Time */ IranStandardTime = "Iran Standard Time", /** * Israel Standard Time */ IsraelStandardTime = "Israel Standard Time", /** * Jordan Standard Time */ JordanStandardTime = "Jordan Standard Time", /** * Kaliningrad Standard Time */ KaliningradStandardTime = "Kaliningrad Standard Time", /** * Kamchatka Standard Time */ KamchatkaStandardTime = "Kamchatka Standard Time", /** * Korea Standard Time */ KoreaStandardTime = "Korea Standard Time", /** * Libya Standard Time */ LibyaStandardTime = "Libya Standard Time", /** * Line Islands Standard Time */ LineIslandsStandardTime = "Line Islands Standard Time", /** * Lord Howe Standard Time */ LordHoweStandardTime = "Lord Howe Standard Time", /** * Magadan Standard Time */ MagadanStandardTime = "Magadan Standard Time", /** * Magallanes Standard Time */ MagallanesStandardTime = "Magallanes Standard Time", /** * Marquesas Standard Time */ MarquesasStandardTime = "Marquesas Standard Time", /** * Mauritius Standard Time */ MauritiusStandardTime = "Mauritius Standard Time", /** * Mid-Atlantic Standard Time */ MidAtlanticStandardTime = "Mid-Atlantic Standard Time", /** * Middle East Standard Time */ MiddleEastStandardTime = "Middle East Standard Time", /** * Montevideo Standard Time */ MontevideoStandardTime = "Montevideo Standard Time", /** * Morocco Standard Time */ MoroccoStandardTime = "Morocco Standard Time", /** * Mountain Standard Time */ MountainStandardTime = "Mountain Standard Time", /** * Mountain Standard Time (Mexico) */ MountainStandardTime_Mexico = "Mountain Standard Time (Mexico)", /** * Myanmar Standard Time */ MyanmarStandardTime = "Myanmar Standard Time", /** * North Central Asia Standard Time */ N_CentralAsiaStandardTime = "N. Central Asia Standard Time", /** * Namibia Standard Time */ NamibiaStandardTime = "Namibia Standard Time", /** * Nepal Standard Time */ NepalStandardTime = "Nepal Standard Time", /** * New Zealand Standard Time */ NewZealandStandardTime = "New Zealand Standard Time", /** * Newfoundland Standard Time */ NewfoundlandStandardTime = "Newfoundland Standard Time", /** * Norfolk Standard Time */ NorfolkStandardTime = "Norfolk Standard Time", /** * North Asia East Standard Time */ NorthAsiaEastStandardTime = "North Asia East Standard Time", /** * North Asia Standard Time */ NorthAsiaStandardTime = "North Asia Standard Time", /** * North Korea Standard Time */ NorthKoreaStandardTime = "North Korea Standard Time", /** * Omsk Standard Time */ OmskStandardTime = "Omsk Standard Time", /** * Pacific SA Standard Time */ PacificSAStandardTime = "Pacific SA Standard Time", /** * Pacific Standard Time */ PacificStandardTime = "Pacific Standard Time", /** * Pacific Standard Time (Mexico) */ PacificStandardTimeMexico = "Pacific Standard Time (Mexico)", /** * Pakistan Standard Time */ PakistanStandardTime = "Pakistan Standard Time", /** * Paraguay Standard Time */ ParaguayStandardTime = "Paraguay Standard Time", /** * Romance Standard Time */ RomanceStandardTime = "Romance Standard Time", /** * Russia Time Zone 10 */ RussiaTimeZone10 = "Russia Time Zone 10", /** * Russia Time Zone 11 */ RussiaTimeZone11 = "Russia Time Zone 11", /** * Russia Time Zone 3 */ RussiaTimeZone3 = "Russia Time Zone 3", /** * Russian Standard Time */ RussianStandardTime = "Russian Standard Time", /** * SA Eastern Standard Time */ SAEasternStandardTime = "SA Eastern Standard Time", /** * SA Pacific Standard Time */ SAPacificStandardTime = "SA Pacific Standard Time", /** * SA Western Standard Time */ SAWesternStandardTime = "SA Western Standard Time", /** * Saint Pierre Standard Time */ SaintPierreStandardTime = "Saint Pierre Standard Time", /** * Sakhalin Standard Time */ SakhalinStandardTime = "Sakhalin Standard Time", /** * Samoa Standard Time */ SamoaStandardTime = "Samoa Standard Time", /** * Saratov Standard Time */ SaratovStandardTime = "Saratov Standard Time", /** * Southeast Asia Standard Time */ SEAsiaStandardTime = "SE Asia Standard Time", /** * Singapore Standard Time */ SingaporeStandardTime = "Singapore Standard Time", /** * South Africa Standard Time */ SouthAfricaStandardTime = "South Africa Standard Time", /** * Sri Lanka Standard Time */ SriLankaStandardTime = "Sri Lanka Standard Time", /** * Sudan Standard Time */ SudanStandardTime = "Sudan Standard Time", /** * Syria Standard Time */ SyriaStandardTime = "Syria Standard Time", /** * Taipei Standard Time */ TaipeiStandardTime = "Taipei Standard Time", /** * Tasmania Standard Time */ TasmaniaStandardTime = "Tasmania Standard Time", /** * Tocantins Standard Time */ TocantinsStandardTime = "Tocantins Standard Time", /** * Tokyo Standard Time */ TokyoStandardTime = "Tokyo Standard Time", /** * Tomsk Standard Time */ TomskStandardTime = "Tomsk Standard Time", /** * Tonga Standard Time */ TongaStandardTime = "Tonga Standard Time", /** * Transbaikal Standard Time */ TransbaikalStandardTime = "Transbaikal Standard Time", /** * Turkey Standard Time */ TurkeyStandardTime = "Turkey Standard Time", /** * Turks And Caicos Standard Time */ TurksAndCaicosStandardTime = "Turks And Caicos Standard Time", /** * Ulaanbaatar Standard Time */ UlaanbaatarStandardTime = "Ulaanbaatar Standard Time", /** * United States Eastern Standard Time */ USEasternStandardTime = "US Eastern Standard Time", /** * United States Mountain Standard Time */ USMountainStandardTime = "US Mountain Standard Time", /** * Coordinated Universal Time (UTC) */ UTC = "UTC", /** * Coordinated Universal Time (UTC) + 12 hours */ UTCPLUS12 = "UTC+12", /** * Coordinated Universal Time (UTC) + 13 hours */ UTCPLUS13 = "UTC+13", /** * Coordinated Universal Time (UTC) - 2 hours */ UTCMINUS02 = "UTC-02", /** * Coordinated Universal Time (UTC) - 8 hours */ UTCMINUS08 = "UTC-08", /** * Coordinated Universal Time (UTC) - 9 hours */ UTCMINUS09 = "UTC-09", /** * Coordinated Universal Time (UTC) - 11 hours */ UTCMINUS11 = "UTC-11", /** * Venezuela Standard Time */ VenezuelaStandardTime = "Venezuela Standard Time", /** * Vladivostok Standard Time */ VladivostokStandardTime = "Vladivostok Standard Time", /** * West Australia Standard Time */ W_AustraliaStandardTime = "W. Australia Standard Time", /** * West Central Africa Standard Time */ W_CentralAfricaStandardTime = "W. Central Africa Standard Time", /** * West Europe Standard Time */ W_EuropeStandardTime = "W. Europe Standard Time", /** * West Mongolia Standard Time */ W_MongoliaStandardTime = "W. Mongolia Standard Time", /** * West Asia Standard Time */ WestAsiaStandardTime = "West Asia Standard Time", /** * West Bank Standard Time */ WestBankStandardTime = "West Bank Standard Time", /** * West Pacific Standard Time */ WestPacificStandardTime = "West Pacific Standard Time", /** * Yakutsk Standard Time */ YakutskStandardTime = "Yakutsk Standard Time" } /** * Specifies the type of recurrence. * * @remarks * [Api set: Mailbox 1.7] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose or Read */ enum RecurrenceType { /** * Daily. */ Daily = "daily", /** * Weekday. */ Weekday = "weekday", /** * Weekly. */ Weekly = "weekly", /** * Monthly. */ Monthly = "monthly", /** * Yearly. */ Yearly = "yearly" } /** * Specifies the type of response to a meeting invitation. * * @remarks * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose or Read */ enum ResponseType { /** * There has been no response from the attendee. */ None = "none", /** * The attendee is the meeting organizer. */ Organizer = "organizer", /** * The meeting request was tentatively accepted by the attendee. */ Tentative = "tentative", /** * The meeting request was accepted by the attendee. */ Accepted = "accepted", /** * The meeting request was declined by the attendee. */ Declined = "declined" } /** * Specifies the version of the REST API that corresponds to a REST-formatted item ID. * * @remarks * [Api set: Mailbox 1.3] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose or Read */ enum RestVersion { /** * Version 1.0. */ v1_0 = "v1.0", /** * Version 2.0. */ v2_0 = "v2.0", /** * Beta. */ Beta = "beta" } /** * Specifies the {@link https://learn.microsoft.com/office/dev/add-ins/outlook/smart-alerts-onmessagesend-walkthrough#available-send-mode-options | send mode option} * that overrides the option set in the manifest at runtime. * * For information on how to implement a Smart Alerts add-in, see * {@link https://learn.microsoft.com/office/dev/add-ins/outlook/smart-alerts-onmessagesend-walkthrough | Use Smart Alerts and the OnMessageSend and OnAppointmentSend events in your Outlook add-in}. * * @remarks * [Api set: Mailbox preview] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose * * @beta */ enum SendModeOverride { /** * Provides the **Send Anyway** option in a Smart Alerts dialog when the mail item doesn't meet the conditions of the event-based add-in. * To learn more, see the {@link https://learn.microsoft.com/office/dev/add-ins/outlook/smart-alerts-onmessagesend-walkthrough#prompt-user | **prompt user** send mode option}. * * @beta */ PromptUser = "promptUser" } /** * Specifies the source of the selected data in an item (see `Office.mailbox.item.getSelectedDataAsync` for details). * * @remarks * [Api set: Mailbox 1.2] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose */ enum SourceProperty { /** * The source of the data is from the body of the item. */ Body = "body", /** * The source of the data is from the subject of the item. */ Subject = "subject" } /** * Specifies the week of the month. * * @remarks * [Api set: Mailbox 1.7] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose or Read */ enum WeekNumber { /** * First week of the month. */ First = "first", /** * Second week of the month. */ Second = "second", /** * Third week of the month. */ Third = "third", /** * Fourth week of the month. */ Fourth = "fourth", /** * Last week of the month. */ Last = "last" } } /** * Provides an option for the data format. */ interface CoercionTypeOptions { /** * The desired data format. */ coercionType?: Office.CoercionType | string; } /** * The subclass of {@link Office.Item | Item} dealing with appointments. * * **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`. For more information, refer to the * {@link https://learn.microsoft.com/javascript/api/requirement-sets/outlook/preview-requirement-set/office.context.mailbox.item | Object Model} page. * * Child interfaces: * * - {@link Office.AppointmentCompose | AppointmentCompose} * * - {@link Office.AppointmentRead | AppointmentRead} */ interface Appointment extends Item { } /** * The appointment organizer mode of {@link Office.Item | Office.context.mailbox.item}. * * **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`. For more information, refer to the * {@link https://learn.microsoft.com/javascript/api/requirement-sets/outlook/preview-requirement-set/office.context.mailbox.item | Object Model} page. * * Parent interfaces: * * - {@link Office.ItemCompose | ItemCompose} * * - {@link Office.Appointment | Appointment} */ interface AppointmentCompose extends Appointment, ItemCompose { /** * Gets an object that provides methods for manipulating the body of an item. * * @remarks * [Api set: Mailbox 1.1] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Appointment Organizer */ body: Body; /** * Gets an object that provides methods for managing the item's categories. * * @remarks * [Api set: Mailbox 1.8] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Appointment Organizer */ categories: Categories; /** * Gets or sets the date and time that the appointment is to end. * * The `end` property is a {@link Office.Time | Time} object expressed as a Coordinated Universal Time (UTC) date and time value. * You can use the `convertToLocalClientTime` method to convert the `end` property value to the client's local date and time. * * When you use the `Time.setAsync` method to set the end time, you should use the `convertToUtcClientTime` method to convert the local time on * the client to UTC for the server. * * **Important**: In the Windows client, you can't use this property to update the end of a recurrence. * * @remarks * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Appointment Organizer */ end: Time; /** * Gets or sets the locations of the appointment. The `enhancedLocation` property returns an {@link Office.EnhancedLocation | EnhancedLocation} * object that provides methods to get, remove, or add locations on an item. * * @remarks * [Api set: Mailbox 1.8] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Appointment Organizer */ enhancedLocation: EnhancedLocation; /** * Gets or sets the {@link Office.IsAllDayEvent} property of an appointment. * * @remarks * [Api set: Mailbox preview] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Appointment Organizer * * @beta */ isAllDayEvent: IsAllDayEvent; /** * 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://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Appointment Organizer */ itemType: MailboxEnums.ItemType | string; /** * Gets or sets the location of an appointment. The `location` property returns a {@link Office.Location | Location} object that provides methods that are * used to get and set the location of the appointment. * * @remarks * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Appointment Organizer */ location: Location; /** * Gets the notification messages for an item. * * @remarks * [Api set: Mailbox 1.3] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Appointment Organizer */ notificationMessages: NotificationMessages; /** * Provides access to the optional attendees of an event. The type of object and level of access depend on the mode of the current item. * * The `optionalAttendees` property returns a `Recipients` object that provides methods to get or update the * optional attendees for a meeting. However, depending on the client/platform (i.e., Windows, Mac, etc.), limits may apply on how many * recipients you can get or update. See the {@link Office.Recipients | Recipients} object for more details. * * @remarks * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Appointment Organizer */ optionalAttendees: Recipients; /** * Gets the organizer for the specified meeting. * * The `organizer` property returns an {@link Office.Organizer | Organizer} object that provides a method to get the organizer value. * * @remarks * [Api set: Mailbox 1.7] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read/write item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Appointment Organizer */ organizer: Organizer; /** * Gets or sets the recurrence pattern of an appointment. * * The `recurrence` property returns a recurrence object for recurring appointments or meetings requests if an item is a series or an instance * in a series. `null` is returned for single appointments and meeting requests of single appointments. * * **Note**: Meeting requests have an `itemClass` value of `IPM.Schedule.Meeting.Request`. * * **Note**: If the recurrence object is null, this indicates that the object is a single appointment or a meeting request of a single * appointment and NOT a part of a series. * * @remarks * [Api set: Mailbox 1.7] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Appointment Organizer */ recurrence: Recurrence; /** * Provides access to the required attendees of an event. The type of object and level of access depend on the mode of the current item. * * The `requiredAttendees` property returns a `Recipients` object that provides methods to get or update the * required attendees for a meeting. However, depending on the client/platform (i.e., Windows, Mac, etc.), limits may apply on how many * recipients you can get or update. See the {@link Office.Recipients | Recipients} object for more details. * * @remarks * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Appointment Organizer */ requiredAttendees: Recipients; /** * Gets or sets the {@link Office.Sensitivity | sensitivity level} of an appointment. * For information about sensitivity levels, see * {@link https://support.microsoft.com/office/4a76d05b-6c29-4a0d-9096-71784a6b12c1 | Mark your email as Normal, Personal, Private, or Confidential}. * * @remarks * [Api set: Mailbox preview] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Appointment Organizer * * @beta */ sensitivity: Sensitivity; /** * Gets the object to get or set the {@link Office.SensitivityLabel | sensitivity label} of an appointment. * * @remarks * [Api set: Mailbox preview] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read/write item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Appointment Organizer * * **Important**: To use the sensitivity label feature in your add-in, you must have a Microsoft 365 E5 subscription. * * To learn more about how to manage sensitivity labels in your add-in, see * {@link https://learn.microsoft.com/office/dev/add-ins/outlook/sensitivity-label | Manage the sensitivity label of your message or appointment in compose mode (preview)}. * * @beta */ sensitivityLabel: SensitivityLabel; /** * Gets the ID of the series that an instance belongs to. * * In Outlook on the web and desktop clients, the `seriesId` property 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://learn.microsoft.com/office/dev/add-ins/outlook/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. * * @remarks * [Api set: Mailbox 1.7] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Appointment Organizer */ seriesId: string; /** * Manages the {@link Office.SessionData | SessionData} of an item in Compose mode. * * **Important**: The entire SessionData object is limited to 50,000 characters per add-in. * * @remarks * [Api set: Mailbox 1.11] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Appointment Organizer */ sessionData: SessionData; /** * Gets or sets the date and time that the appointment is to begin. * * The `start` property is a {@link Office.Time | Time} object expressed as a Coordinated Universal Time (UTC) date and time value. * You can use the `convertToLocalClientTime` method to convert the value to the client's local date and time. * * When you use the `Time.setAsync` method to set the start time, you should use the `convertToUtcClientTime` method to convert the local time on * the client to UTC for the server. * * **Important**: In the Windows client, you can't use this property to update the start of a recurrence. * * @remarks * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Appointment Organizer */ start: Time; /** * 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://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Appointment Organizer */ 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. * * **Important**: In recent builds of Outlook on Windows, a bug was introduced that incorrectly appends an `Authorization: Bearer` header to * this action (whether using this API or the Outlook UI). To work around this issue, you can try using the `addFileAttachmentFromBase64` API * introduced with requirement set 1.8. * * @remarks * [Api set: Mailbox 1.1] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read/write item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Appointment Organizer * * **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 - 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 function. * `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. * * **Important**: In recent builds of Outlook on Windows, a bug was introduced that incorrectly appends an `Authorization: Bearer` header to * this action (whether using this API or the Outlook UI). To work around this issue, you can try using the `addFileAttachmentFromBase64` API * introduced with requirement set 1.8. * * @remarks * [Api set: Mailbox 1.1] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read/write item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Appointment Organizer * * **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,`. * * @remarks * [Api set: Mailbox 1.8] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read/write item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Appointment Organizer * * **Errors**: * * - `AttachmentSizeExceeded`: The attachment is larger than allowed. * * - `FileTypeNotSupported`: The attachment has an extension that isn't allowed. * * - `NumberOfAttachmentsExceeded`: The message or appointment has too many attachments. * * **Note**: If you're adding an inline Base64 image to the body of a message or appointment being composed, you must first get the current item body using the * {@link https://learn.microsoft.com/javascript/api/outlook/office.body#outlook-office-body-getasync-member(1) | Office.context.mailbox.item.body.getAsync} * method before inserting the image using `addFileAttachmentFromBase64Async`. Otherwise, the image won't render in the body once it's inserted. * For further guidance, see {@link https://learn.microsoft.com/office/dev/add-ins/outlook/add-and-remove-attachments-to-an-item-in-a-compose-form#attach-a-file | Attach a file}. * * @param base64File - The Base64-encoded content of an image or file to be added to an email or event. The maximum length of the encoded string is 27,892,122 characters (about 25 MB). * @param attachmentName - The name of the attachment that is shown while the attachment is uploading. The maximum length is 255 characters. * @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 function. * `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,`. * * @remarks * [Api set: Mailbox 1.8] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read/write item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Appointment Organizer * * **Errors**: * * - `AttachmentSizeExceeded`: The attachment is larger than allowed. * * - `FileTypeNotSupported`: The attachment has an extension that isn't allowed. * * - `NumberOfAttachmentsExceeded`: The message or appointment has too many attachments. * * **Note**: If you're adding an inline Base64 image to the body of a message or appointment being composed, you must first get the current item body using the * {@link https://learn.microsoft.com/javascript/api/outlook/office.body#outlook-office-body-getasync-member(1) | Office.context.mailbox.item.body.getAsync} * method before inserting the image using `addFileAttachmentFromBase64Async`. Otherwise, the image won't render in the body once it's inserted. * For further guidance, see {@link https://learn.microsoft.com/office/dev/add-ins/outlook/add-and-remove-attachments-to-an-item-in-a-compose-form#attach-a-file | Attach a file}. * * @param base64File - The Base64-encoded content of an image or file to be added to an email or event. The maximum length of the encoded string is 27,892,122 characters (about 25 MB). * @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 event handler for a supported event. **Note**: Events are only available with task pane implementation. * * For supported events, refer to the Item object model * {@link https://learn.microsoft.com/javascript/api/requirement-sets/outlook/preview-requirement-set/office.context.mailbox.item#events | events section}. * * @remarks * [Api set: Mailbox 1.7] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Appointment Organizer * * @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 - 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 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. */ 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 only available with task pane implementation. * * For supported events, refer to the Item object model * {@link https://learn.microsoft.com/javascript/api/requirement-sets/outlook/preview-requirement-set/office.context.mailbox.item#events | events section}. * * @remarks * [Api set: Mailbox 1.7] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Appointment Organizer * * @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; /** * 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 function, 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 function, 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. * * @remarks * [Api set: Mailbox 1.1] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read/write item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Appointment Organizer * * **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 - 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 function. * @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 function, 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 function, 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. * * @remarks * [Api set: Mailbox 1.1] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read/write item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Appointment Organizer * * **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 behavior 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, the `close` method has no effect on a reply in the Reading Pane. * * @remarks * [Api set: Mailbox 1.3] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **restricted** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Appointment Organizer * * **Important**: 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. */ close(): void; /** * Disables the Outlook client signature. * * For Windows and Mac rich clients, this API sets the signature under the "New Message" and "Replies/Forwards" sections * for the sending account to "(none)", effectively disabling the signature. * For Outlook on the web, the API should disable the signature option for new mails, replies, and forwards. * If the signature is selected, this API call should disable it. * * @remarks * [Api set: Mailbox 1.10] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read/write item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#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 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. */ disableClientSignatureAsync(options: Office.AsyncContextOptions, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Disables the Outlook client signature. * * For Windows and Mac rich clients, this API sets the signature under the "New Message" and "Replies/Forwards" sections * for the sending account to "(none)", effectively disabling the signature. * For Outlook on the web, the API should disable the signature option for new mails, replies, and forwards. * If the signature is selected, this API call should disable it. * * @remarks * [Api set: Mailbox 1.10] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read/write item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Appointment Organizer * * @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. */ disableClientSignatureAsync(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 get * the attachment's identifier from a `getAttachmentsAsync` call, then in the same session, use that identifier to retrieve the attachment. * 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. * * @remarks * [Api set: Mailbox 1.8] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Appointment Organizer * * **Errors**: * * - `AttachmentTypeNotSupported`: The attachment type isn't supported. Unsupported types include embedded images in Rich Text Format, * or item attachment types other than email or calendar items (such as a contact or task item). * * - `InvalidAttachmentId`: The attachment identifier does not exist. * * @param attachmentId - The identifier of the attachment you want to get. * @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 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. If the call fails, the `asyncResult.error` property will contain * an 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 get * the attachment's identifier from a `getAttachmentsAsync` call, then in the same session, use that identifier to retrieve the attachment. * 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. * * @remarks * [Api set: Mailbox 1.8] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Appointment Organizer * * **Errors**: * * - `AttachmentTypeNotSupported`: The attachment type isn't supported. Unsupported types include embedded images in Rich Text Format, * or item attachment types other than email or calendar items (such as a contact or task item). * * - `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 * an 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. * * @remarks * [Api set: Mailbox 1.8] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#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 function. * @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 an 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. * * @remarks * [Api set: Mailbox 1.8] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Appointment Organizer * * @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 an error code with the reason for * the failure. */ getAttachmentsAsync(callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Gets initialization data passed when the add-in is {@link https://learn.microsoft.com/outlook/actionable-messages/invoke-add-in | activated by an actionable message}. * * @remarks * [Api set: Mailbox 1.8] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#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 function. * @param callback - 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 context data is provided as a string (or an empty string if there's no initialization context) * in the `asyncResult.value` property. */ getInitializationContextAsync(options: Office.AsyncContextOptions, callback: (asyncResult: Office.AsyncResult) => void): void; /** * Gets initialization data passed when the add-in is {@link https://learn.microsoft.com/outlook/actionable-messages/invoke-add-in | activated by an actionable message}. * * @remarks * [Api set: Mailbox 1.8] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#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`. * On success, the initialization context data is provided as a string (or an empty string if there's no initialization context) * in the `asyncResult.value` property. */ getInitializationContextAsync(callback: (asyncResult: Office.AsyncResult) => void): void; /** * Asynchronously gets the ID of a saved item. * * When invoked, this method returns the item ID via the callback function. * * **Note**: If your add-in calls `getItemIdAsync` on an item in compose mode (e.g., 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 synced to the server. * Until the item is synced, the `itemId` is not recognized and using it returns an error. * * @remarks * [Api set: Mailbox 1.8] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Appointment Organizer * * **Errors**: * * - `ItemNotSaved`: The ID can't be retrieved until the item is saved. * * @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 function. * @param callback - When the method completes, the function passed in the `callback` parameter is called with a single parameter * of type `Office.AsyncResult`. */ getItemIdAsync(options: Office.AsyncContextOptions, callback: (asyncResult: Office.AsyncResult) => void): void; /** * Asynchronously gets the ID of a saved item. * * When invoked, this method returns the item ID via the callback function. * * **Note**: If your add-in calls `getItemIdAsync` on an item in compose mode (e.g., 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 synced to the server. * Until the item is synced, the `itemId` is not recognized and using it returns an error. * * @remarks * [Api set: Mailbox 1.8] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Appointment Organizer * * **Errors**: * * - `ItemNotSaved`: The ID can't be retrieved until the item is saved. * * @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; /** * 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 function, 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`. * * @returns * The selected data as a string with format determined by `coercionType`. * * @remarks * [Api set: Mailbox 1.2] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Appointment Organizer * * @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 function. * @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 function, 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`. * * @returns * The selected data as a string with format determined by `coercionType`. * * @remarks * [Api set: Mailbox 1.2] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Appointment Organizer * * @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; /** * Gets the properties of an appointment or message in a shared folder or shared mailbox. * * For more information around using this API, see * {@link https://learn.microsoft.com/office/dev/add-ins/outlook/delegate-access | Enable shared folders and shared mailbox scenarios in an Outlook add-in}. * * @remarks * [Api set: Mailbox 1.8 for shared folder support, Mailbox 1.13 for shared mailbox support] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Appointment Organizer * * *Note**: This method is not supported in Outlook on iOS or Android. * * @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 function. * @param callback - When the method completes, the function passed in the `callback` parameter is called with a single parameter, `asyncResult`, which is an * `Office.AsyncResult` object. The `asyncResult.value` property provides 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 or shared mailbox. * * For more information around using this API, see * {@link https://learn.microsoft.com/office/dev/add-ins/outlook/delegate-access | Enable shared folders and shared mailbox scenarios in an Outlook add-in}. * * @remarks * [Api set: Mailbox 1.8 for shared folder support, Mailbox 1.13 for shared mailbox support] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Appointment Organizer * * **Note**: This method is not supported in Outlook on iOS or Android. * * @param callback - When the method completes, the function passed in the `callback` parameter is called with a single parameter, `asyncResult`, which is an * `Office.AsyncResult` object. The `asyncResult.value` property provides the properties of the shared item. */ getSharedPropertiesAsync(callback: (asyncResult: Office.AsyncResult) => void): void; /** * Gets if the client signature is enabled. * * For Windows and Mac rich clients, the API call should return `true` if the default signature for new messages, replies, or forwards is set * to a template for the sending Outlook account. * For Outlook on the web, the API call should return `true` if the signature is enabled for compose types `newMail`, `reply`, or `forward`. * If the settings are set to "(none)" in Mac or Windows rich clients or disabled in Outlook on the Web, the API call should return `false`. * * @remarks * [Api set: Mailbox 1.10] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#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 function. * @param callback - When the method completes, the function passed in the `callback` parameter is called with a single parameter of * type `Office.AsyncResult`. */ isClientSignatureEnabledAsync(options: Office.AsyncContextOptions, callback: (asyncResult: Office.AsyncResult) => void): void; /** * Gets if the client signature is enabled. * * For Windows and Mac rich clients, the API call should return `true` if the default signature for new messages, replies, or forwards is set * to a template for the sending Outlook account. * For Outlook on the web, the API call should return `true` if the signature is enabled for compose types `newMail`, `reply`, or `forward`. * If the settings are set to "(none)" in Mac or Windows rich clients or disabled in Outlook on the Web, the API call should return `false`. * * @remarks * [Api set: Mailbox 1.10] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#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`. */ isClientSignatureEnabledAsync(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 {@link Office.CustomProperties | 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 aren't encrypted on the item, so this shouldn't 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, save, and remove custom properties from the mail item. * * @remarks * [Api set: Mailbox 1.1] * * To learn more about custom properties, see * {@link https://learn.microsoft.com/office/dev/add-ins/outlook/metadata-for-an-outlook-add-in | Get and set add-in metadata for an Outlook add-in}. * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#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`. * @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 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. * * @remarks * [Api set: Mailbox 1.1] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read/write item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Appointment Organizer * * **Errors**: * * - `InvalidAttachmentId`: The attachment identifier does not exist. * * @param attachmentId - The identifier of the attachment to remove. The maximum string length of the `attachmentId` * is 200 characters in Outlook on the web and on Windows. * @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 function. * @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. * * @remarks * [Api set: Mailbox 1.1] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read/write item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Appointment Organizer * * **Errors**: * * - `InvalidAttachmentId`: The attachment identifier does not exist. * * @param attachmentId - The identifier of the attachment to remove. The maximum string length of the `attachmentId` * is 200 characters in Outlook on the web and on Windows. * @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; /** * Removes the event handlers for a supported event type. **Note**: Events are only available with task pane implementation. * * For supported events, refer to the Item object model * {@link https://learn.microsoft.com/javascript/api/requirement-sets/outlook/preview-requirement-set/office.context.mailbox.item#events | events section}. * * @remarks * [Api set: Mailbox 1.7] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Appointment Organizer * * @param eventType - The event that should revoke the handler. * @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 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. */ 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 only available with task pane implementation. * * For supported events, refer to the Item object model * {@link https://learn.microsoft.com/javascript/api/requirement-sets/outlook/preview-requirement-set/office.context.mailbox.item#events | events section}. * * @remarks * [Api set: Mailbox 1.7] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Appointment Organizer * * @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; /** * Asynchronously saves an item. * * Since appointments have no draft state, if `saveAsync` is called on an appointment in compose mode, the item is saved as a normal * appointment on the user's calendar. For new appointments that haven't been saved before, no invitation is sent. * For existing appointments, an update is sent to added or removed attendees. * * @remarks * [Api set: Mailbox 1.3] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read/write item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Appointment Organizer * * **Important**: * * - 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. * * - When working with HTML-formatted content, it's important to note that the Outlook client may modify the content. This means that * subsequent calls to methods like `Body.getAsync`, `Body.setAsync`, and even `saveAsync` may not result in the same content. * * - If your add-in calls `saveAsync` on an item in compose mode in order to get an item ID 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 item ID will return an error. * * - In Outlook on Mac, only Build 16.35.308 or later supports saving a meeting. * Otherwise, the `saveAsync` method fails when called from a meeting in compose mode. * For a workaround, see {@link https://learn.microsoft.com/outlook/troubleshoot/calendars/cannot-save-meeting-as-draft-in-outlook-for-mac | Cannot save a meeting as a draft in Outlook for Mac by using Office JS API}. * * **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 function. * @param callback - When the method completes, the function passed in the `callback` parameter is called with a single parameter, `asyncResult`, * which is an `Office.AsyncResult` object. The appointment ID is returned in the `asyncResult.value` property. */ saveAsync(options: Office.AsyncContextOptions, callback: (asyncResult: Office.AsyncResult) => void): void; /** * Asynchronously saves an item. * * Since appointments have no draft state, if `saveAsync` is called on an appointment in compose mode, the item is saved as a normal * appointment on the user's calendar. For new appointments that haven't been saved before, no invitation is sent. * For existing appointments, an update is sent to added or removed attendees. * * @remarks * [Api set: Mailbox 1.3] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read/write item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Appointment Organizer * * **Important**: * * - 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. * * - When working with HTML-formatted content, it's important to note that the Outlook client may modify the content. This means that * subsequent calls to methods like `Body.getAsync`, `Body.setAsync`, and even `saveAsync` may not result in the same content. * * - If your add-in calls `saveAsync` on an item in compose mode in order to get an item ID 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 item ID will return an error. * * - In Outlook on Mac, only Build 16.35.308 or later supports saving a meeting. * Otherwise, the `saveAsync` method fails when called from a meeting in compose mode. * For a workaround, see {@link https://learn.microsoft.com/outlook/troubleshoot/calendars/cannot-save-meeting-as-draft-in-outlook-for-mac | Cannot save a meeting as a draft in Outlook for Mac by using Office JS API}. * * **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, `asyncResult`, * which is an `Office.AsyncResult` object. The appointment ID is returned in the `asyncResult.value` property. */ 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. * * @remarks * [Api set: Mailbox 1.2] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read/write item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Appointment Organizer * * **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 - 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 function. * `coercionType`: If text, the current style is applied in Outlook on the web and Windows. * 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. * * @remarks * [Api set: Mailbox 1.2] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read/write item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Appointment Organizer * * **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 `AppointmentForm` object is used to access the currently selected appointment. * * @remarks * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **restricted** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose or Read */ interface AppointmentForm { /** * Gets an object that provides methods for manipulating the body of an item. * * @remarks * [Api set: Mailbox 1.1] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose or Read */ body: Body | string; /** * Gets or sets the date and time that the appointment is to end. * * The `end` property is expressed as a Coordinated Universal Time (UTC) date and time value. You can use the `convertToLocalClientTime` method to * convert the `end` property value to the client's local date and time. * * *Read mode* * * The `end` property returns a `Date` object. * * *Compose mode* * * The `end` property returns a `Time` object. * * When you use the `Time.setAsync` method to set the end time, you should use the `convertToUtcClientTime` method to convert the local time on * the client to UTC for the server. * * @remarks * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose or Read */ end: Time | Date; /** * Gets or sets the location of an appointment. * * *Read mode* * * The `location` property returns a string that contains the location of the appointment. * * *Compose mode* * * The `location` property returns a `Location` object that provides methods that are used to get and set the location of the appointment. * * @remarks * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose or Read */ location: Location | string; /** * Provides access to the optional attendees of an event. The type of object and level of access depend on the mode of the current item. * * *Read mode* * * The `optionalAttendees` property returns an array that contains an {@link Office.EmailAddressDetails | EmailAddressDetails} object for * each optional attendee to the meeting. Collection size limits: * * - Windows: 500 members * * - Classic Mac UI: 100 members * * - New Mac UI, web browser, Android: No limit * * *Compose mode* * * The `optionalAttendees` property returns a `Recipients` object that provides methods to get or update the * optional attendees for a meeting. However, depending on the client/platform (i.e., Windows, Mac, etc.), limits may apply on how many * recipients you can get or update. See the {@link Office.Recipients | Recipients} object for more details. * * @remarks * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose or Read */ optionalAttendees: Recipients[] | EmailAddressDetails[]; /** * Provides access to the resources of an event. Returns an array of strings containing the resources required for the appointment. * * @remarks * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose or Read */ resources: string[]; /** * Provides access to the required attendees of an event. The type of object and level of access depend on the mode of the current item. * * *Read mode* * * The `requiredAttendees` property returns an array that contains an {@link Office.EmailAddressDetails | EmailAddressDetails} object for * each required attendee to the meeting. Collection size limits: * * - Windows: 500 members * * - Classic Mac UI: 100 members * * - New Mac UI, web browser, Android: No limit * * *Compose mode* * * The `requiredAttendees` property returns a `Recipients` object that provides methods to get or update the * required attendees for a meeting. However, depending on the client/platform (i.e., Windows, Mac, etc.), limits may apply on how many * recipients you can get or update. See the {@link Office.Recipients | Recipients} object for more details. * * @remarks * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose or Read */ requiredAttendees: Recipients[] | EmailAddressDetails[]; /** * Gets or sets the date and time that the appointment is to begin. * * The `start` property is expressed as a Coordinated Universal Time (UTC) date and time value. You can use the `convertToLocalClientTime` method * to convert the value to the client's local date and time. * * *Read mode* * * The `start` property returns a `Date` object. * * *Compose mode* * * The `start` property returns a `Time` object. * * When you use the `Time.setAsync` method to set the start time, you should use the `convertToUtcClientTime` method to convert the local time on * the client to UTC for the server. * * @remarks * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose or Read */ start: Time | Date; /** * 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. * * *Read mode* * * The `subject` property returns a string. Use the `normalizedSubject` property to get the subject minus any leading prefixes such as RE: and FW:. * * *Compose mode* * * The `subject` property returns a `Subject` object that provides methods to get and set the subject. * * @remarks * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose or Read */ subject: Subject | string; } /** * The appointment attendee mode of {@link Office.Item | Office.context.mailbox.item}. * * **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`. For more information, refer to the * {@link https://learn.microsoft.com/javascript/api/requirement-sets/outlook/preview-requirement-set/office.context.mailbox.item | Object Model} page. * * Parent interfaces: * * - {@link Office.ItemRead | ItemRead} * * - {@link Office.Appointment | Appointment} */ interface AppointmentRead extends Appointment, ItemRead { /** * Gets the item's attachments as an array. * * @remarks * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Appointment Attendee * * **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.microsoft.com/office/434752e1-02d3-4e90-9124-8b81e49a8519 | Blocked attachments in Outlook}. * */ attachments: AttachmentDetails[]; /** * Gets an object that provides methods for manipulating the body of an item. * * @remarks * [Api set: Mailbox 1.1] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Appointment Attendee */ body: Body; /** * Gets an object that provides methods for managing the item's categories. * * @remarks * [Api set: Mailbox 1.8] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Appointment Attendee */ categories: Categories; /** * Gets the date and time that an item was created. * * @remarks * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Appointment Attendee */ dateTimeCreated: Date; /** * Gets the date and time that an item was last modified. * * @remarks * [Api set: Mailbox 1.1] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Appointment Attendee * * **Important**: This property isn't supported in Outlook on Android or on iOS. For more information on supported APIs in Outlook mobile, see * {@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-mobile-apis | Outlook JavaScript APIs supported in Outlook on mobile devices}. */ dateTimeModified: Date; /** * Gets the date and time that the appointment is to end. * * The `end` property is a `Date` object expressed as a Coordinated Universal Time (UTC) date and time value. * You can use the `convertToLocalClientTime` method to convert the `end` property value to the client's local date and time. * * When you use the `Time.setAsync` method to set the end time, you should use the `convertToUtcClientTime` method to convert the local time on * the client to UTC for the server. * * @remarks * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Appointment Attendee */ end: Date; /** * Gets the locations of an appointment. * * The `enhancedLocation` property returns an {@link Office.EnhancedLocation | EnhancedLocation} object that allows you to get the set of locations * (each represented by a {@link Office.LocationDetails | LocationDetails} object) associated with the appointment. * * @remarks * [Api set: Mailbox 1.8] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Appointment Attendee */ enhancedLocation: EnhancedLocation; /** * Returns a boolean value indicating whether the event is all day. * * @remarks * [Api set: Mailbox preview] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Appointment Attendee * * @beta */ isAllDayEvent: boolean; /** * 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://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Appointment Attendee * * 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://learn.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://learn.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://learn.microsoft.com/office/dev/add-ins/outlook/use-rest-api#get-the-item-id | Use the Outlook REST APIs from an Outlook add-in}. * * @remarks * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Appointment Attendee */ itemId: string; /** * 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://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Appointment Attendee */ itemType: MailboxEnums.ItemType | string; /** * Gets the location of an appointment. * * The `location` property returns a string that contains the location of the appointment. * * @remarks * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Appointment Attendee */ location: 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://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Appointment Attendee */ normalizedSubject: string; /** * Gets the notification messages for an item. * * @remarks * [Api set: Mailbox 1.3] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Appointment Attendee */ notificationMessages: NotificationMessages; /** * Provides access to the optional attendees of an event. The type of object and level of access depend on the mode of the current item. * * The `optionalAttendees` property returns an array that contains an {@link Office.EmailAddressDetails | EmailAddressDetails} object for * each optional attendee to the meeting. The maximum number of attendees returned varies per Outlook client. * * - Windows: 500 attendees * * - Android, classic Mac UI, iOS: 100 attendees * * - New Mac UI, web browser: No limit * * @remarks * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Appointment Attendee */ optionalAttendees: EmailAddressDetails[]; /** * Gets the meeting organizer's email properties. * * @remarks * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Appointment Attendee */ organizer: EmailAddressDetails; /** * Gets the recurrence pattern of an appointment. Gets the recurrence pattern of a meeting request. * * The `recurrence` property returns a {@link Office.Recurrence | Recurrence} object for recurring appointments or meetings requests * if an item is a series or an instance in a series. `null` is returned for single appointments and meeting requests of single appointments. * * **Note**: Meeting requests have an `itemClass` value of `IPM.Schedule.Meeting.Request`. * * **Note**: If the recurrence object is null, this indicates that the object is a single appointment or a meeting request of a single * appointment and NOT a part of a series. * * @remarks * [Api set: Mailbox 1.7] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Appointment Attendee */ recurrence: Recurrence; /** * Provides access to the required attendees of an event. The type of object and level of access depend on the mode of the current item. * * The `requiredAttendees` property returns an array that contains an {@link Office.EmailAddressDetails | EmailAddressDetails} object for * each required attendee to the meeting. The maximum number of attendees returned varies per Outlook client. * * - Windows: 500 attendees * * - Android, classic Mac UI, iOS: 100 attendees * * - New Mac UI, web browser: No limit * * @remarks * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Appointment Attendee */ requiredAttendees: EmailAddressDetails[]; /** * Gets the date and time that the appointment is to begin. * * The `start` property is a `Date` object expressed as a Coordinated Universal Time (UTC) date and time value. * You can use the `convertToLocalClientTime` method to convert the value to the client's local date and time. * * @remarks * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Appointment Attendee */ start: Date; /** * 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://learn.microsoft.com/office/dev/add-ins/outlook/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. * * @remarks * [Api set: Mailbox 1.7] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Appointment Attendee */ seriesId: 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://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Appointment Attendee */ subject: string; /** * Provides the sensitivity value of the appointment. * * @remarks * [Api set: Mailbox preview] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Appointment Attendee * * @beta */ sensitivity: MailboxEnums.AppointmentSensitivityType; /** * Adds an event handler for a supported event. **Note**: Events are only available with task pane implementation. * * For supported events, refer to the Item object model * {@link https://learn.microsoft.com/javascript/api/requirement-sets/outlook/preview-requirement-set/office.context.mailbox.item#events | events section}. * * @remarks * [Api set: Mailbox 1.7] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Appointment Attendee * * @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 - 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 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. */ 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 only available with task pane implementation. * * For supported events, refer to the Item object model * {@link https://learn.microsoft.com/javascript/api/requirement-sets/outlook/preview-requirement-set/office.context.mailbox.item#events | events section}. * * @remarks * [Api set: Mailbox 1.7] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Appointment Attendee * * @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; /** * Displays a reply form that includes either the sender and all recipients of the selected message or the organizer and all attendees of the * selected appointment. * * @remarks * [Api set: Mailbox 1.1] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Appointment Attendee * * **Important**: * * - 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-column 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 attempts 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. * * - This method isn't supported in Outlook on Android or on iOS. For more information on supported APIs in Outlook mobile, see * {@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-mobile-apis | Outlook JavaScript APIs supported in Outlook on mobile devices}. * * @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. */ displayReplyAllForm(formData: string | ReplyFormData): void; /** * Displays a reply form that includes either 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-column or 1-column view. * * If any of the string parameters exceed their limits, `displayReplyAllFormAsync` throws an exception. * * When attachments are specified in the `formData.attachments` parameter, Outlook attempts 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 * [Api set: Mailbox 1.9] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Appointment Attendee * * @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 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 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. */ displayReplyAllFormAsync(formData: string | ReplyFormData, options: Office.AsyncContextOptions, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Displays a reply form that includes either 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-column or 1-column view. * * If any of the string parameters exceed their limits, `displayReplyAllFormAsync` throws an exception. * * When attachments are specified in the `formData.attachments` parameter, Outlook attempts 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 * [Api set: Mailbox 1.9] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Appointment Attendee * * @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. */ displayReplyAllFormAsync(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. * * @remarks * [Api set: Mailbox 1.1] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Appointment Attendee * * **Important**: * * - 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-column 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 attempts 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. * * - This method isn't supported in Outlook on Android or on iOS. For more information on supported APIs in Outlook mobile, see * {@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-mobile-apis | Outlook JavaScript APIs supported in Outlook on mobile devices}. * * @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. */ displayReplyForm(formData: string | ReplyFormData): 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-column or 1-column view. * * If any of the string parameters exceed their limits, `displayReplyFormAsync` throws an exception. * * When attachments are specified in the `formData.attachments` parameter, Outlook attempts 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 * [Api set: Mailbox 1.9] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Appointment Attendee * * @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 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 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. */ displayReplyFormAsync(formData: string | ReplyFormData, options: Office.AsyncContextOptions, 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-column or 1-column view. * * If any of the string parameters exceed their limits, `displayReplyFormAsync` throws an exception. * * When attachments are specified in the `formData.attachments` parameter, Outlook attempts 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 * [Api set: Mailbox 1.9] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Appointment Attendee * * @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. */ displayReplyFormAsync(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 get * the attachment's identifier from an {@link Office.AppointmentRead.attachments | item.attachments} call, then in the same session, use that identifier * to retrieve the attachment. 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. * * @remarks * [Api set: Mailbox 1.8] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Appointment Attendee * * **Errors**: * * - `AttachmentTypeNotSupported`: The attachment type isn't supported. Unsupported types include embedded images in Rich Text Format, * or item attachment types other than email or calendar items (such as a contact or task item). * * - `InvalidAttachmentId`: The attachment identifier does not exist. * * @param attachmentId - The identifier of the attachment you want to get. * @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 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. If the call fails, the `asyncResult.error` property will contain * an 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 get * the attachment's identifier from an {@link Office.AppointmentRead.attachments | item.attachments} call, then in the same session, use that identifier * to retrieve the attachment. 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. * * @remarks * [Api set: Mailbox 1.8] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Appointment Attendee * * **Errors**: * * - `AttachmentTypeNotSupported`: The attachment type isn't supported. Unsupported types include embedded images in Rich Text Format, * or item attachment types other than email or calendar items (such as a contact or task item). * * - `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 * an 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. * * @remarks * [Api set: Mailbox 1.1] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Appointment Attendee * * **Important**: This method isn't supported in Outlook on Android or on iOS. For more information on supported APIs in Outlook mobile, see * {@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-mobile-apis | Outlook JavaScript APIs supported in Outlook on mobile devices}. */ getEntities(): Entities; /** * Gets an array of all the entities of the specified entity type found in the selected item's body. * * @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 * [Api set: Mailbox 1.1] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **restricted** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Appointment Attendee * * **Important**: This method isn't supported in Outlook on Android or on iOS. For more information on supported APIs in Outlook mobile, see * {@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-mobile-apis | Outlook JavaScript APIs supported in Outlook on mobile devices}. * * @param entityType - One of the `EntityType` enumeration values. * * While the minimum permission level to use this method is **restricted**, some entity types require **read item** 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 an XML manifest file. * * @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. If there's no `ItemHasKnownEntity` element in the manifest with a * `FilterName` element value that matches the `name` parameter, the method returns `null`. If the `name` parameter matches an * `ItemHasKnownEntity` element in the manifest, but there are no entities in the current item that match, the method returns an empty array. * * @remarks * [Api set: Mailbox 1.1] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Appointment Attendee * * **Important**: * * - This method is used with the {@link https://learn.microsoft.com/office/dev/add-ins/outlook/activation-rules | activation rules feature for Outlook add-ins}, * which isn't supported by the {@link https://learn.microsoft.com/office/dev/add-ins/develop/json-manifest-overview | Teams manifest for Office Add-ins (preview)}. * * - This method isn't supported in Outlook on Android or on iOS. For more information on supported APIs in Outlook mobile, see * {@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-mobile-apis | Outlook JavaScript APIs supported in Outlook on mobile devices}. * * @param name - The name of the `ItemHasKnownEntity` rule element that defines the filter to match. */ getFilteredEntitiesByName(name: string): (string | Contact | MeetingSuggestion | PhoneNumber | TaskSuggestion)[]; /** * Gets initialization data passed when the add-in is {@link https://learn.microsoft.com/outlook/actionable-messages/invoke-add-in | activated by an actionable message}. * * @remarks * [Api set: Mailbox 1.8] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#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 function. * @param callback - 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 context data is provided as a string (or an empty string if there's no initialization context) * in the `asyncResult.value` property. */ getInitializationContextAsync(options: Office.AsyncContextOptions, callback: (asyncResult: Office.AsyncResult) => void): void; /** * Gets initialization data passed when the add-in is {@link https://learn.microsoft.com/outlook/actionable-messages/invoke-add-in | activated by an actionable message}. * * @remarks * [Api set: Mailbox 1.8] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#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`. * On success, the initialization context data is provided as a string (or an empty string if there's no initialization context) * in the `asyncResult.value` property. */ getInitializationContextAsync(callback: (asyncResult: Office.AsyncResult) => void): void; /** * Returns string values in the selected item that match the regular expressions defined in an XML manifest file. * * @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. For an `ItemHasRegularExpressionMatch` rule, a matching string has to occur in the property * of the item that's specified by that rule. The `PropertyName` simple type defines the supported properties. * * @remarks * [Api set: Mailbox 1.1] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Appointment Attendee * * **Important**: * * - This method is used with the {@link https://learn.microsoft.com/office/dev/add-ins/outlook/activation-rules | activation rules feature for Outlook add-ins}, * which isn't supported by the {@link https://learn.microsoft.com/office/dev/add-ins/develop/json-manifest-overview | Teams manifest for Office Add-ins (preview)}. * * - If you specify an `ItemHasRegularExpressionMatch` rule on the body property of an item, the regular expression should further filter the body * and shouldn't attempt to return the entire body of the item. Using a regular expression such as `.*` to obtain the entire body of an item doesn't always return the expected results. * Instead, use the `Body.getAsync` method to retrieve the entire body. * * - This method isn't supported in Outlook on Android or on iOS. For more information on supported APIs in Outlook mobile, see * {@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-mobile-apis | Outlook JavaScript APIs supported in Outlook on mobile devices}. */ getRegExMatches(): any; /** * Returns string values in the selected item that match the named regular expression defined in an XML manifest file. * * @returns * An array that contains the strings that match the regular expression defined in the `ItemHasRegularExpressionMatch` rule element in the manifest XML file, * with the specified `RegExName` element value. * * @remarks * [Api set: Mailbox 1.1] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Appointment Attendee * * **Important**: * * - This method is used with the {@link https://learn.microsoft.com/office/dev/add-ins/outlook/activation-rules | activation rules feature for Outlook add-ins}, * which isn't supported by the {@link https://learn.microsoft.com/office/dev/add-ins/develop/json-manifest-overview | Teams manifest for Office Add-ins (preview)}. * * - If you specify an `ItemHasRegularExpressionMatch` rule on the body property of an item, the regular expression should further filter the body * and shouldn't attempt to return the entire body of the item. Using a regular expression such as `.*` to obtain the entire body of an item doesn't always return the expected results. * Instead, use the `Body.getAsync` method to retrieve the entire body. * * - This method isn't supported in Outlook on Android or on iOS. For more information on supported APIs in Outlook mobile, see * {@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-mobile-apis | Outlook JavaScript APIs supported in Outlook on mobile devices}. * * @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 used with the {@link https://learn.microsoft.com/office/dev/add-ins/outlook/activation-rules | activation rules feature for Outlook add-ins}, which isn't supported by the {@link https://learn.microsoft.com/office/dev/add-ins/develop/json-manifest-overview | Teams manifest for Office Add-ins (preview)}. * * **Note**: This method is not supported in Outlook on iOS or Android. * * @remarks * [Api set: Mailbox 1.6] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Appointment Attendee * * @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 an XML manifest file. * Highlighted matches apply to contextual add-ins. * * **Note**: This method is used with the {@link https://learn.microsoft.com/office/dev/add-ins/outlook/activation-rules | activation rules feature for Outlook add-ins}, which isn't supported by the {@link https://learn.microsoft.com/office/dev/add-ins/develop/json-manifest-overview | Teams manifest for Office Add-ins (preview)}. * * 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. * * @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 * [Api set: Mailbox 1.6] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Appointment Attendee */ getSelectedRegExMatches(): any; /** * Gets the properties of an appointment or message in a shared folder or shared mailbox. * * For more information around using this API, see * {@link https://learn.microsoft.com/office/dev/add-ins/outlook/delegate-access | Enable shared folders and shared mailbox scenarios in an Outlook add-in}. * * @remarks * [Api set: Mailbox 1.8 for shared folder support, Mailbox 1.13 for shared mailbox support] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Appointment Attendee * * **Note**: This method is not supported in Outlook on iOS or Android. * * @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 function. * @param callback - When the method completes, the function passed in the `callback` parameter is called with a single parameter, `asyncResult`, which is an * `Office.AsyncResult` object. The `asyncResult.value` property provides 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 or shared mailbox. * * For more information around using this API, see * {@link https://learn.microsoft.com/office/dev/add-ins/outlook/delegate-access | Enable shared folders and shared mailbox scenarios in an Outlook add-in}. * * @remarks * [Api set: Mailbox 1.8 for shared folder support, Mailbox 1.13 for shared mailbox support] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Appointment Attendee * * **Note**: This method is not supported in Outlook on iOS or Android. * * @param callback - When the method completes, the function passed in the `callback` parameter is called with a single parameter, `asyncResult`, which is an * `Office.AsyncResult` object. The `asyncResult.value` property provides 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 {@link Office.CustomProperties | 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 aren't encrypted on the item, so this shouldn't 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, save, and remove custom properties from the mail item. * * @remarks * [Api set: Mailbox 1.1] * * To learn more about custom properties, see * {@link https://learn.microsoft.com/office/dev/add-ins/outlook/metadata-for-an-outlook-add-in | Get and set add-in metadata for an Outlook add-in}. * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#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`. * @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 only available with task pane implementation. * * For supported events, refer to the Item object model * {@link https://learn.microsoft.com/javascript/api/requirement-sets/outlook/preview-requirement-set/office.context.mailbox.item#events | events section}. * * @remarks * [Api set: Mailbox 1.7] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Appointment Attendee * * @param eventType - The event that should revoke the handler. * @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 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. */ 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 only available with task pane implementation. * * For supported events, refer to the Item object model * {@link https://learn.microsoft.com/javascript/api/requirement-sets/outlook/preview-requirement-set/office.context.mailbox.item#events | events section}. * * @remarks * [Api set: Mailbox 1.7] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Appointment Attendee * * @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; } /** * Provides the current dates and times of the appointment that raised the `Office.EventType.AppointmentTimeChanged` event. * * @remarks * [Api set: Mailbox 1.7] */ export interface AppointmentTimeChangedEventArgs { /** * Gets the appointment end date and time. * * @remarks * [Api set: Mailbox 1.7] */ end: Date; /** * Gets the appointment start date and time. * * @remarks * [Api set: Mailbox 1.7] */ start: Date; /** * Gets the type of the event. For details, refer to {@link https://learn.microsoft.com/javascript/api/office/office.eventtype | Office.EventType}. * * @remarks * [Api set: Mailbox 1.7] */ type: "olkAppointmentTimeChanged"; } /** * Represents the content of an attachment on a message or appointment item. * * @remarks * [Api set: Mailbox 1.8] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose or Read */ interface AttachmentContent { /** * The content of an attachment as a string. */ content: string; /** * The string format to use for an attachment's content. * * For file attachments, the formatting is a base64-encoded string. * * For item attachments that represent messages and were attached by drag-and-drop or "Attach Item", * the formatting is a string representing an .eml formatted file. * **Important**: If a message item was attached by drag-and-drop in Outlook on the web, then `getAttachmentContentAsync` throws an error. * * For item attachments that represent calendar items and were attached by drag-and-drop or "Attach Item", * the formatting is a string representing an .icalendar file. * **Important**: If a calendar item was attached by drag-and-drop in Outlook on the web, then `getAttachmentContentAsync` throws an error. * * For cloud attachments, the formatting is a URL string. */ format: MailboxEnums.AttachmentContentFormat | string; } /** * Represents an attachment on an item. Compose mode only. * * An array of `AttachmentDetailsCompose` objects is returned as the attachments property of an appointment or message item. * * @remarks * [Api set: Mailbox 1.8] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose */ interface AttachmentDetailsCompose { /** * Gets a value that indicates the type of an attachment. */ attachmentType: MailboxEnums.AttachmentType | string; /** * Gets the index of the attachment. */ id: string; /** * Gets a value that indicates whether the attachment should be displayed in the body of the item. */ isInline: boolean; /** * Gets the name of the attachment. * * **Important**: For message or appointment items that were attached by drag-and-drop or "Attach Item", * `name` includes a file extension in Outlook on Mac, but excludes the extension on the web or Windows. */ name: string; /** * Gets the size of the attachment in bytes. */ size: number; /** * Gets the url of the attachment if its type is `MailboxEnums.AttachmentType.Cloud`. */ url?: string; } /** * Represents an attachment on an item from the server. Read mode only. * * An array of `AttachmentDetails` objects is returned as the attachments property of an appointment or message item. * * @remarks * [Api set: Mailbox 1.1] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Read */ interface AttachmentDetails { /** * Gets a value that indicates the type of an attachment. */ attachmentType: MailboxEnums.AttachmentType | string; /** * Gets the MIME content type of the attachment. * * **Warning**: While the `contentType` value is a direct lookup of the attachment's extension, the internal mapping isn't actively maintained * so this property has been deprecated. If you require specific types, grab the attachment's extension and process accordingly. For details, * refer to the {@link https://devblogs.microsoft.com/microsoft365dev/outlook-javascript-api-deprecation-for-attachmentdetails-contenttype-property/ | related blog post }. * * @deprecated If you require specific content types, grab the attachment's extension and process accordingly. */ contentType: string; /** * Gets the Exchange attachment ID of the attachment. * However, if the attachment type is `MailboxEnums.AttachmentType.Cloud`, then a URL for the file is returned. */ id: string; /** * Gets a value that indicates whether the attachment should be displayed in the body of the item. */ isInline: boolean; /** * Gets the name of the attachment. * * **Important**: For message or appointment items that were attached by drag-and-drop or "Attach Item", * `name` includes a file extension in Outlook on Mac, but excludes the extension on the web or Windows. */ name: string; /** * Gets the size of the attachment in bytes. */ size: number; } /** * Provides information about the attachments that raised the `Office.EventType.AttachmentsChanged` event. * * @remarks * [Api set: Mailbox 1.8] */ export interface AttachmentsChangedEventArgs { /** * Represents the set of attachments that were added or removed. * For each such attachment, gets `id`, `name`, `size`, and `attachmentType` properties. * * @remarks * [Api set: Mailbox 1.8] */ attachmentDetails: object[]; /** * Gets whether the attachments were added or removed. For details, refer to {@link Office.MailboxEnums.AttachmentStatus | MailboxEnums.AttachmentStatus}. * * @remarks * [Api set: Mailbox 1.8] */ attachmentStatus: MailboxEnums.AttachmentStatus | string; /** * Gets the type of the event. For details, refer to {@link https://learn.microsoft.com/javascript/api/office/office.eventtype | Office.EventType}. * * @remarks * [Api set: Mailbox 1.8] */ type: "olkAttachmentsChanged"; } /** * The body object provides methods for adding and updating the content of the message or appointment. * It is returned in the body property of the selected item. * * @remarks * [Api set: Mailbox 1.1] * * **Known issue with HTML table border colors** * * Outlook on Windows: If you're setting various cell borders to different colors in an HTML table in Compose mode, a cell's borders may not reflect * the expected color. For the known behavior, visit {@link https://github.com/OfficeDev/office-js/issues/1818 | OfficeDev/office-js issue #1818}. * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose or Read */ interface Body { /** * Appends on send the specified content to the end of the item body, after any signature. * * To use `appendOnSendAsync`, you must specify a supplementary permission in the manifest. Details vary with the type of manifest. See {@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Understanding Outlook add-in permissions}. To learn more * about append-on-send and its configuration, see * {@link https://learn.microsoft.com/office/dev/add-ins/outlook/append-on-send | Implement append-on-send in your Outlook add-in}. * * **Important**: If the {@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-on-send-addins?tabs=windows | on-send feature} * is implemented with append-on-send, the following apply. * * - If the user is running add-ins that implement the on-send feature using `ItemSend` in the manifest, append-on-send runs before on-send functionality. * * - If your add-in implements the on-send feature and calls `appendOnSendAsync` in the `ItemSend` handler, * the `appendOnSendAsync` call returns an error as this scenario isn't supported. * * **Recommended**: Call `getTypeAsync` then pass the returned value to the `options.coercionType` parameter. * * **Note**: To clear data from a previous `appendOnSendAsync` call, you can call it again with the `data` parameter set to `null`. * * @remarks * [Api set: Mailbox 1.9] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read/write item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose * * **Errors**: * * - `DataExceedsMaximumSize`: The `data` parameter is longer than 5,000 characters. * * - `InvalidFormatError`: The `options.coercionType` parameter is set to `Office.CoercionType.Html` but the message body is in plain text. * * @param data - The string to be added to the end of the body. The string is limited to 5,000 characters. * @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 function. * `coercionType`: The desired format for the data to be appended. The string in the `data` parameter will be converted to this format. * @param callback - Optional. When the method completes, the function passed in the `callback` parameter is called with a single parameter * of type `Office.AsyncResult`. Any errors encountered will be provided in the `asyncResult.error` property. */ appendOnSendAsync(data: string, options: Office.AsyncContextOptions & CoercionTypeOptions, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Appends on send the specified content to the end of the item body, after any signature. * * To use `appendOnSendAsync`, you must specify a supplementary permission in the manifest. Details vary with the type of manifest. See {@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Understanding Outlook add-in permissions}. To learn more * about append-on-send and its configuration, see * {@link https://learn.microsoft.com/office/dev/add-ins/outlook/append-on-send | Implement append-on-send in your Outlook add-in}. * * **Important**: If the {@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-on-send-addins?tabs=windows | on-send feature} * is implemented with append-on-send, the following apply. * * - If the user is running add-ins that implement the on-send feature using `ItemSend` in the manifest, append-on-send runs before on-send functionality. * * - If your add-in implements the on-send feature and calls `appendOnSendAsync` in the `ItemSend` handler, * the `appendOnSendAsync` call returns an error as this scenario isn't supported. * * **Recommended**: Call `getTypeAsync` then pass the returned value to the `options.coercionType` parameter. * * **Note**: To clear data from a previous `appendOnSendAsync` call, you can call it again with the `data` parameter set to `null`. * * @remarks * [Api set: Mailbox 1.9] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read/write item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose * * **Errors**: * * - `DataExceedsMaximumSize`: The `data` parameter is longer than 5,000 characters. * * - `InvalidFormatError`: The `options.coercionType` parameter is set to `Office.CoercionType.Html` but the message body is in plain text. * * @param data - The string to be added to the end of the body. The string is limited to 5,000 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`. Any errors encountered will be provided in the `asyncResult.error` property. */ appendOnSendAsync(data: string, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Returns the current body in a specified format. * * This method returns the entire current body in the format specified by `coercionType`. * * @remarks * [Api set: Mailbox 1.3] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose or Read * * **Important**: When working with HTML-formatted bodies, it's important to note that the value returned by the `Body.getAsync` method won't necessarily * be the exact same value that was previously passed in the `Body.setAsync` method. The client may modify the value passed to `setAsync` to make it * render efficiently with its rendering engine. * * @param coercionType - The format for the returned body. * @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 function. * @param callback - Optional. When the method completes, the function passed in the `callback` parameter is called with a single parameter * of type Office.AsyncResult. The body is provided in the requested format in the `asyncResult.value` property. */ getAsync(coercionType: Office.CoercionType | string, options: Office.AsyncContextOptions, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Returns the current body in a specified format. * * This method returns the entire current body in the format specified by `coercionType`. * * @remarks * [Api set: Mailbox 1.3] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose or Read * * **Important**: When working with HTML-formatted bodies, it's important to note that the value returned by the `Body.getAsync` method won't necessarily * be the exact same value that was previously passed in the `Body.setAsync` method. The client may modify the value passed to `setAsync` to make it * render efficiently with its rendering engine. * * @param coercionType - The format for the returned body. * @param callback - Optional. When the method completes, the function passed in the `callback` parameter is called with a single parameter * of type Office.AsyncResult. The body is provided in the requested format in the `asyncResult.value` property. */ getAsync(coercionType: Office.CoercionType | string, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Gets a value that indicates whether the content is in HTML or text format. * * @remarks * [Api set: Mailbox 1.1] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose * * **Important**: In Outlook on Android and on iOS, this method isn't supported in the Message Compose mode. Only the Appointment Organizer mode is * supported. For more information on supported APIs in Outlook mobile, see * {@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-mobile-apis | Outlook JavaScript APIs supported in Outlook on mobile devices}. * * @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 function. * @param callback - Optional. When the method completes, the function passed in the `callback` parameter is called with a single parameter * of type `Office.AsyncResult`. * The content type is returned as one of the `CoercionType` values in the `asyncResult.value` property. */ getTypeAsync(options: Office.AsyncContextOptions, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Gets a value that indicates whether the content is in HTML or text format. * * @remarks * [Api set: Mailbox 1.1] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose * * **Important**: In Outlook on Android and on iOS, this` method isn't supported in the Message Compose mode. Only the Appointment Organizer mode is * supported. For more information on supported APIs in Outlook mobile, see * {@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-mobile-apis | Outlook JavaScript APIs supported in Outlook on mobile devices}. * * @param callback - Optional. When the method completes, the function passed in the `callback` parameter is called with a single parameter * of type `Office.AsyncResult`. * The content type is returned as one of the `CoercionType` values in the `asyncResult.value` property. */ getTypeAsync(callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Adds the specified content to the beginning of the item body. * * @remarks * [Api set: Mailbox 1.1] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read/write item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose * * **Important**: * * - After the content is prepended, the position of the cursor depends on which client the add-in is running. In Outlook on Windows and on the web, the cursor * position remains the same in the pre-existing content of the body. For example, if the cursor was positioned at the beginning of the body prior to the * `prependAsync` call, it will appear between the prepended content and the pre-existing content of the body after the call. In Outlook on Mac, the cursor * position isn't preserved. The cursor disappears after the `prependAsync` call and only reappears when the user selects something in the body of the mail item. * * - When working with HTML-formatted bodies, it's important to note that the client may modify the value passed to `prependAsync` to * make it render efficiently with its rendering engine. This means that the value returned from a subsequent call to the `Body.getAsync` method * (introduced in Mailbox 1.3) won't necessarily contain the exact value that was passed in the previous `prependAsync` call. * * - When including links in HTML markup, you can disable online link preview by setting the `id` attribute on the anchor (\) to "LPNoLP" * (see the **Examples** section for a sample). * * - In Outlook on Android and on iOS, this method isn't supported in the Message Compose mode. Only the Appointment Organizer mode is * supported. For more information on supported APIs in Outlook mobile, see * {@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-mobile-apis | Outlook JavaScript APIs supported in Outlook on mobile devices}. * * **Recommended**: Call `getTypeAsync`, then pass the returned value to the `options.coercionType` parameter. * * **Errors**: * * - `DataExceedsMaximumSize`: The data parameter is longer than 1,000,000 characters. * * @param data - The string to be inserted at the beginning of the body. The string is limited to 1,000,000 characters. * @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 function. * `coercionType`: The desired format for the body. The string in the `data` parameter will be converted to this format. * @param callback - Optional. When the method completes, the function passed in the `callback` parameter is called with a single parameter * of type `Office.AsyncResult`. Any errors encountered will be provided in the `asyncResult.error` property. */ prependAsync(data: string, options: Office.AsyncContextOptions & CoercionTypeOptions, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Adds the specified content to the beginning of the item body. * * @remarks * [Api set: Mailbox 1.1] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read/write item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose * * **Important**: * * - After the content is prepended, the position of the cursor depends on which client the add-in is running. In Outlook on Windows and on the web, the cursor * position remains the same in the pre-existing content of the body. For example, if the cursor was positioned at the beginning of the body prior to the * `prependAsync` call, it will appear between the prepended content and the pre-existing content of the body after the call. In Outlook on Mac, the cursor * position isn't preserved. The cursor disappears after the `prependAsync` call and only reappears when the user selects something in the body of the mail item. * * - When working with HTML-formatted bodies, it's important to note that the client may modify the value passed to `prependAsync` to * make it render efficiently with its rendering engine. This means that the value returned from a subsequent call to the `Body.getAsync` method * (introduced in Mailbox 1.3) won't necessarily contain the exact value that was passed in the previous `prependAsync` call. * * - When including links in HTML markup, you can disable online link preview by setting the `id` attribute on the anchor (\) to "LPNoLP" * (see the **Examples** section for a sample). * * - In Outlook on Android and on iOS, this method isn't supported in the Message Compose mode. Only the Appointment Organizer mode is * supported. For more information on supported APIs in Outlook mobile, see * {@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-mobile-apis | Outlook JavaScript APIs supported in Outlook on mobile devices}. * * **Recommended**: Call `getTypeAsync`, then pass the returned value to the `options.coercionType` parameter. * * **Errors**: * * - `DataExceedsMaximumSize`: The data parameter is longer than 1,000,000 characters. * * @param data - The string to be inserted at the beginning of the body. The string is limited to 1,000,000 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`. Any errors encountered will be provided in the `asyncResult.error` property. */ prependAsync(data: string, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Prepends HTML or plain text to the beginning of a message or appointment body when the mail item is sent. * * To use `prependOnSendAsync`, you must specify a supplementary permission in the manifest. Details vary with the type of manifest. For guidance, * see {@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Understanding Outlook add-in permissions}. * * @remarks * [Api set: Mailbox 1.13] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read/write item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose * * **Recommended**: Call `getTypeAsync`, then pass its returned value to the `options.coercionType` parameter. * * **Important**: When implementing `prependOnSendAsync`, keep the following in mind. * * - In a {@link https://learn.microsoft.com/office/dev/add-ins/outlook/smart-alerts-onmessagesend-walkthrough | Smart Alerts add-in}, * the prepend-on-send feature runs first. * * - A new line is added after the prepended content. * * - If multiple active add-ins call `prependOnSendAsync`, the order of the inserted content depends on the order in which the add-in runs. * The content of the last run add-in appears above previously prepended content. * * - If the add-in attempts to insert HTML into a plain text body, the content won't be prepended. Conversely, plain text will be inserted into an HTML body. * * **Errors**: * * - `DataExceedsMaximumSize`: The `data` parameter exceeds 5,000 characters. * * - `InvalidFormatError`: The `options.coercionType` parameter is set to `Office.CoercionType.Html`, but the item body is in plain text format. * * @param data - The string to be prepended to the beginning of the message or appointment body. The string is limited to 5,000 characters. * @param options - An object literal that contains one or more of the following properties:- * `asyncContext`: Any object that can be accessed in the callback function. * `coercionType`: The desired format for the body. The string in the `data` parameter is converted to this format. * @param callback - Optional. When the method completes, the function passed in the `callback` parameter is called with a single parameter * of type `Office.AsyncResult`. Any errors encountered will be provided in the `asyncResult.error` property. */ prependOnSendAsync(data: string, options: Office.AsyncContextOptions & CoercionTypeOptions, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Prepends HTML or plain text to the beginning of a message or appointment body when the mail item is sent. * * To use `prependOnSendAsync`, you must specify a supplementary permission in the manifest. Details vary with the type of manifest. For guidance, * see {@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Understanding Outlook add-in permissions}. * * @remarks * [Api set: Mailbox 1.13] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read/write item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose * * **Recommended**: Call `getTypeAsync`, then pass its returned value to the `options.coercionType` parameter. * * **Important**: When implementing `prependOnSendAsync`, keep the following in mind. * * - In a {@link https://learn.microsoft.com/office/dev/add-ins/outlook/smart-alerts-onmessagesend-walkthrough | Smart Alerts add-in}, * the prepend-on-send feature runs first. * * - A new line is added after the prepended content. * * - If multiple active add-ins call `prependOnSendAsync`, the order of the inserted content depends on the order in which the add-in runs. * The content of the last run add-in appears above previously prepended content. * * - If the add-in attempts to insert HTML into a plain text body, the content won't be prepended. Conversely, plain text will be inserted into an HTML body. * * **Errors**: * * - `DataExceedsMaximumSize`: The `data` parameter exceeds 5,000 characters. * * - `InvalidFormatError`: The `options.coercionType` parameter is set to `Office.CoercionType.Html`, but the item body is in plain text format. * * @param data - The string to be prepended to the beginning of the message or appointment body. The string is limited to 5,000 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`. Any errors encountered will be provided in the `asyncResult.error` property. */ prependOnSendAsync(data: string, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Replaces the entire body with the specified text. * * @remarks * [Api set: Mailbox 1.3] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read/write item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose * * **Important**: * * - After the body is replaced with the specified content, the position of the cursor depends on which client the add-in is running. In Outlook on Windows, * the cursor appears at the beginning of the body of the mail item, while in Outlook on the web, the cursor appears at the end of the body of the mail item. * In Outlook on Mac, the cursor position isn't preserved. The cursor disappears after the `prependAsync` call and only reappears when the user selects * something in the body of the mail item. * * - When working with HTML-formatted bodies, it's important to note that the value returned by the `Body.getAsync` method won't necessarily * be the exact same value that was previously passed in the `Body.setAsync` method. The client may modify the value passed to `setAsync` to make it * render efficiently with its rendering engine. * * - When including links in HTML markup, you can disable online link preview by setting the `id` attribute on the anchor (\) to "LPNoLP" * (see the **Examples** section for a sample). * * - In Outlook on Windows and on Mac, the add-in user isn't able to revert this action with the **Undo** command. * * - In Outlook on Android and on iOS, this method isn't supported in the Message Compose mode. Only the Appointment Organizer mode is * supported. For more information on supported APIs in Outlook mobile, see * {@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-mobile-apis | Outlook JavaScript APIs supported in Outlook on mobile devices}. * * **Recommended**: Call `getTypeAsync`, then pass the returned value to the `options.coercionType` parameter. * * **Errors**: * * - `DataExceedsMaximumSize`: The data parameter is longer than 1,000,000 characters. * * - `InvalidFormatError`: The `options.coercionType` parameter is set to `Office.CoercionType.Html` and the message body is in plain text. * * @param data - The string that will replace the existing body. The string is limited to 1,000,000 characters. * @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 function. * `coercionType`: The desired format for the body. The string in the `data` parameter will be converted to this format. * @param callback - Optional. When the method completes, the function passed in the `callback` parameter is called with a single parameter * of type Office.AsyncResult. Any errors encountered will be provided in the `asyncResult.error` property. */ setAsync(data: string, options: Office.AsyncContextOptions & CoercionTypeOptions, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Replaces the entire body with the specified text. * * @remarks * [Api set: Mailbox 1.3] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read/write item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose * * **Important**: * * - After the body is replaced with the specified content, the position of the cursor depends on which client the add-in is running. In Outlook on Windows, * the cursor appears at the beginning of the body of the mail item, while in Outlook on the web, the cursor appears at the end of the body of the mail item. * In Outlook on Mac, the cursor position isn't preserved. The cursor disappears after the `prependAsync` call and only reappears when the user selects * something in the body of the mail item. * * - When working with HTML-formatted bodies, it's important to note that the value returned by the `Body.getAsync` method won't necessarily * be the exact same value that was previously passed in the `Body.setAsync` method. The client may modify the value passed to `setAsync` to make it * render efficiently with its rendering engine. * * - When including links in HTML markup, you can disable online link preview by setting the `id` attribute on the anchor (\) to "LPNoLP" * (see the **Examples** section for a sample). * * - In Outlook on Windows and on Mac, the add-in user isn't able to revert this action with the **Undo** command. * * - In Outlook on Android and on iOS, this method isn't supported in the Message Compose mode. Only the Appointment Organizer mode is * supported. For more information on supported APIs in Outlook mobile, see * {@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-mobile-apis | Outlook JavaScript APIs supported in Outlook on mobile devices}. * * **Recommended**: Call `getTypeAsync`, then pass the returned value to the `options.coercionType` parameter. * * **Errors**: * * - `DataExceedsMaximumSize`: The data parameter is longer than 1,000,000 characters. * * - `InvalidFormatError`: The `options.coercionType` parameter is set to `Office.CoercionType.Html` and the message body is in plain text. * * @param data - The string that will replace the existing body. The string is limited to 1,000,000 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. Any errors encountered will be provided in the `asyncResult.error` property. */ setAsync(data: string, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Replaces the selection in the body with the specified text. * * The `setSelectedDataAsync` method inserts the specified string at the cursor location in the body of the item, or, if text is selected in * the editor, it replaces the selected text. If the cursor was never in the body of the item, or if the body of the item lost focus in the * UI, the string will be inserted at the top of the body content. After insertion, the cursor is placed at the end of the inserted content. * * When including links in HTML markup, you can disable online link preview by setting the `id` attribute on the anchor (\) to "LPNoLP" * (see the **Examples** section for a sample). * * **Recommended**: Call `getTypeAsync` then pass the returned value to the `options.coercionType` parameter. * * @remarks * [Api set: Mailbox 1.1] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read/write item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose * * **Errors**: * * - `DataExceedsMaximumSize`: The `data` parameter is longer than 1,000,000 characters. * * - `InvalidFormatError`: The `options.coercionType` parameter is set to `Office.CoercionType.Html` and the message body is in plain text. * * @param data - The string that will replace the existing body. The string is limited to 1,000,000 characters. * @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 function. * `coercionType`: The desired format for the body. The string in the `data` parameter will be converted to this format. * @param callback - Optional. When the method completes, the function passed in the `callback` parameter is called with a single parameter * of type `Office.AsyncResult`. Any errors encountered will be provided in the `asyncResult.error` property. */ setSelectedDataAsync(data: string, options: Office.AsyncContextOptions & CoercionTypeOptions, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Replaces the selection in the body with the specified text. * * The `setSelectedDataAsync` method inserts the specified string at the cursor location in the body of the item, or, if text is selected in * the editor, it replaces the selected text. If the cursor was never in the body of the item, or if the body of the item lost focus in the * UI, the string will be inserted at the top of the body content. After insertion, the cursor is placed at the end of the inserted content. * * When including links in HTML markup, you can disable online link preview by setting the `id` attribute on the anchor (\) to "LPNoLP" * (see the **Examples** section for a sample). * * **Recommended**: Call `getTypeAsync` then pass the returned value to the `options.coercionType` parameter. * * @remarks * [Api set: Mailbox 1.1] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read/write item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose * * **Errors**: * * - `DataExceedsMaximumSize`: The `data` parameter is longer than 1,000,000 characters. * * - `InvalidFormatError`: The `options.coercionType` parameter is set to `Office.CoercionType.Html` and the message body is in plain text. * * @param data - The string that will replace the existing body. The string is limited to 1,000,000 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`. Any errors encountered will be provided in the `asyncResult.error` property. */ setSelectedDataAsync(data: string, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Adds or replaces the signature of the item body. * * @remarks * [Api set: Mailbox 1.10] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read/write item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose * * **Important**: * * - In Outlook on the web, `setSignatureAsync` only works on messages. * * - This method is supported in Message Compose on Outlook on Android and on iOS. For a sample scenario, see * {@link https://learn.microsoft.com/office/dev/add-ins/outlook/mobile-event-based | Implement event-based activation in Outlook mobile add-ins}. * To learn more about APIs supported in Outlook mobile, see * {@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-mobile-apis | Outlook JavaScript APIs supported in Outlook on mobile devices}. * * - The behavior of `setSignatureAsync` differs if you call it in the event handler of an add-in that implements the * {@link https://learn.microsoft.com/office/dev/add-ins/outlook/autolaunch | event-based activation feature using `LaunchEvent` in the manifest}. * When the user composes a new item (including reply or forward), the signature is set but doesn't modify the form. This means * if the user closes the form without making other edits, they won't be prompted to save changes. * * **Errors**: * * - `DataExceedsMaximumSize`: The `data` parameter is longer than 30,000 characters. * * - `InvalidFormatError`: The `options.coercionType` parameter is set to `Office.CoercionType.Html` and the message body is in plain text. * * @param data - The string that represents the signature to be set in the body of the mail. This string is limited to 30,000 characters. * @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 function. * `coercionType`: The format the signature should be set to. If Text, the method sets the signature to plain text, * removing any HTML tags present. If Html, the method sets the signature to HTML. * @param callback - Optional. When the method completes, the function passed in the `callback` parameter is called with a single parameter * of type `Office.AsyncResult`. */ setSignatureAsync(data: string, options: Office.AsyncContextOptions & CoercionTypeOptions, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Adds or replaces the signature of the item body. * * @remarks * [Api set: Mailbox 1.10] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read/write item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose * * **Important**: * * - In Outlook on the web, `setSignatureAsync` only works on messages. * * - This method is supported in Message Compose on Outlook on Android and on iOS. For a sample scenario, see * {@link https://learn.microsoft.com/office/dev/add-ins/outlook/mobile-event-based | Implement event-based activation in Outlook mobile add-ins}. * To learn more about APIs supported in Outlook mobile, see * {@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-mobile-apis | Outlook JavaScript APIs supported in Outlook on mobile devices}. * * - The behavior of `setSignatureAsync` differs if you call it in the event handler of an add-in that implements the * {@link https://learn.microsoft.com/office/dev/add-ins/outlook/autolaunch | event-based activation feature using `LaunchEvent` in the manifest}. * When the user composes a new item (including reply or forward), the signature is set but doesn't modify the form. This means * if the user closes the form without making other edits, they won't be prompted to save changes. * * **Errors**: * * - `DataExceedsMaximumSize`: The `data` parameter is longer than 30,000 characters. * * - `InvalidFormatError`: The `options.coercionType` parameter is set to `Office.CoercionType.Html` and the message body is in plain text. * * @param data - The string that represents the signature to be set in the body of the mail. This string is limited to 30,000 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`. */ setSignatureAsync(data: string, callback?: (asyncResult: Office.AsyncResult) => void): void; } /** * Represents the categories on an item. * * In Outlook, a user can tag messages and appointments by using a category to color-code them. * The user defines {@link Office.MasterCategories | categories in a master list} on their mailbox. * They can then apply one or more categories to an item. * * **Important**: In Outlook on the web, you can't use the API to manage categories applied to a message in Compose mode. * * @remarks * [Api set: Mailbox 1.8] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose or Read */ interface Categories { /** * Adds categories to an item. Each category must be in the categories master list on that mailbox and so must have a unique name * but multiple categories can use the same color. * * **Important**: In Outlook on the web, you can't use the API to manage categories applied to a message or appointment item in Compose mode. * * @remarks * [Api set: Mailbox 1.8] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read/write item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose or Read * * **Errors**: * * - `InvalidCategory`: Invalid categories were provided. * * @param categories - The categories to be added to the item. * @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 function. * @param callback - Optional. When the method completes, the function passed in the `callback` parameter is called with a single parameter of * type `Office.AsyncResult`. */ addAsync(categories: string[], options: Office.AsyncContextOptions, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Adds categories to an item. Each category must be in the categories master list on that mailbox and so must have a unique name * but multiple categories can use the same color. * * **Important**: In Outlook on the web, you can't use the API to manage categories applied to a message or appointment item in Compose mode. * * @remarks * [Api set: Mailbox 1.8] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read/write item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose or Read * * **Errors**: * * - `InvalidCategory`: Invalid categories were provided. * * @param categories - The categories to be added to the item. * @param callback - Optional. When the method completes, the function passed in the `callback` parameter is called with a single parameter of * type `Office.AsyncResult`. */ addAsync(categories: string[], callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Gets an item's categories. * * **Important**: * * - If there are no categories on the item, `null` or an empty array will be returned depending on the Outlook version * so make sure to handle both cases. * * - In Outlook on the web, you can't use the API to manage categories applied to a message in Compose mode. * * @remarks * [Api set: Mailbox 1.8] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#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 function. * @param callback - When the method completes, the function passed in the `callback` parameter is called with a single parameter of * type `Office.AsyncResult`. If getting categories fails, the `asyncResult.error` property will contain an error code. */ getAsync(options: Office.AsyncContextOptions, callback: (asyncResult: Office.AsyncResult) => void): void; /** * Gets an item's categories. * * **Important**: * * - If there are no categories on the item, `null` or an empty array will be returned depending on the Outlook version * so make sure to handle both cases. * * - In Outlook on the web, you can't use the API to manage categories applied to a message in Compose mode. * * @remarks * [Api set: Mailbox 1.8] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#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`. If getting categories fails, the `asyncResult.error` property will contain an error code. */ getAsync(callback: (asyncResult: Office.AsyncResult) => void): void; /** * Removes categories from an item. * * **Important**: In Outlook on the web, you can't use the API to manage categories applied to a message in Compose mode. * * @remarks * [Api set: Mailbox 1.8] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read/write item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose or Read * * @param categories - The categories to be removed from the item. * @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 function. * @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 categories fails, the `asyncResult.error` property will contain an error code. */ removeAsync(categories: string[], options: Office.AsyncContextOptions, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Removes categories from an item. * * **Important**: In Outlook on the web, you can't use the API to manage categories applied to a message in Compose mode. * * @remarks * [Api set: Mailbox 1.8] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read/write item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose or Read * * @param categories - The categories to be removed from the item. * @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 categories fails, the `asyncResult.error` property will contain an error code. */ removeAsync(categories: string[], callback?: (asyncResult: Office.AsyncResult) => void): void; } /** * Represents a category's details like name and associated color. * * @remarks * [Api set: Mailbox 1.8] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose or Read */ interface CategoryDetails { /** * The name of the category. Maximum length is 255 characters. */ displayName: string; /** * The color of the category. */ color: MailboxEnums.CategoryColor | string; } /** * Represents the details about a contact (similar to what's on a physical contact or business card) extracted from the item's body. Read mode only. * * The list of contacts extracted from the body of an email message or appointment is returned in the `contacts` property of the * {@link Office.Entities | Entities} object returned by the `getEntities` or `getEntitiesByType` method of the current item. * * @remarks * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **restricted** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Read */ interface Contact { /** * An array of strings containing the mailing and street addresses associated with the contact. Nullable. */ addresses: string[]; /** * A string containing the name of the business associated with the contact. Nullable. */ businessName: string; /** * An array of strings containing the SMTP email addresses associated with the contact. Nullable. */ emailAddresses: string[]; /** * A string containing the name of the person associated with the contact. Nullable. */ personName: string; /** * An array containing a `PhoneNumber` object for each phone number associated with the contact. Nullable. */ phoneNumbers: PhoneNumber[]; /** * An array of strings containing the Internet URLs associated with the contact. Nullable. */ urls: string[]; } /** * The `CustomProperties` object represents custom properties that are specific to a particular mail item and specific to an Outlook add-in. * For example, there might be a need for an add-in to save some data that's specific to the current message that activated the add-in. * If the user revisits the same message in the future and activates the add-in again, the add-in will be able to retrieve the data that had * been saved as custom properties. * * To learn more about `CustomProperties`, see * {@link https://learn.microsoft.com/office/dev/add-ins/outlook/metadata-for-an-outlook-add-in | Get and set add-in metadata for an Outlook add-in}. * * @remarks * [Api set: Mailbox 1.1] * * When using custom properties in your add-in, keep in mind that: * * - Custom properties saved while in compose mode aren't transmitted to recipients of the mail item. When a message or appointment with custom * properties is sent, its properties can be accessed from the item in the Sent Items folder. * If you want to make custom data accessible to recipients, consider using {@link Office.InternetHeaders | InternetHeaders} instead. * * - The maximum length of a `CustomProperties` JSON object is 2500 characters. * * - Outlook on Mac doesn't cache custom properties. If the user's network goes down, mail add-ins can't access their custom properties. * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose or Read */ interface CustomProperties { /** * Returns the value of the specified custom property. * * @returns The value of the specified custom property. * * @remarks * [Api set: Mailbox 1.1] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose or Read * * @param name - The name of the custom property to be returned. */ get(name: string): any; /** * Returns an object with all custom properties in a collection of name/value pairs. The following are equivalent. * * `customProps.get("name")` * * `var dictionary = customProps.getAll(); dictionary["name"]` * * You can iterate through the dictionary object to discover all `names` and `values`. * * @returns An object with all custom properties in a collection of name/value pairs. * * @remarks * [Api set: Mailbox 1.9] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose or Read */ getAll(): any; /** * Removes the specified property from the custom property collection. * * To make the removal of the property permanent, you must call the `saveAsync` method of the `CustomProperties` object. * * @remarks * [Api set: Mailbox 1.1] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose or Read * * @param name - The `name` of the property to be removed. */ remove(name: string): void; /** * Saves custom properties to a message or appointment. * * You must call the `saveAsync` method to persist any changes made with the `set` method or the `remove` method of the `CustomProperties` object. * The saving action is asynchronous. * * It's a good practice to have your callback function check for and handle errors from `saveAsync`. * In particular, a read add-in can be activated while the user is in a connected state in a read form, and subsequently the user becomes * disconnected. * If the add-in calls `saveAsync` while in the disconnected state, `saveAsync` would return an error. * Your callback function should handle this error accordingly. * * @remarks * [Api set: Mailbox 1.1] * * **Important**: In Outlook on Windows, custom properties saved while in compose mode only persist after the item being composed is closed or * after `Office.context.mailbox.item.saveAsync` is called. * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#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 asyncContext - Optional. Any state data that is passed to the callback function. */ saveAsync(callback: (asyncResult: Office.AsyncResult) => void, asyncContext?: any): void; /** * Saves custom properties to a message or appointment. * * You must call the `saveAsync` method to persist any changes made with the `set` method or the `remove` method of the `CustomProperties` object. * The saving action is asynchronous. * * It's a good practice to have your callback function check for and handle errors from `saveAsync`. * In particular, a read add-in can be activated while the user is in a connected state in a read form, and subsequently the user becomes * disconnected. * If the add-in calls `saveAsync` while in the disconnected state, `saveAsync` would return an error. * Your callback function should handle this error accordingly. * * @remarks * [Api set: Mailbox 1.1] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose or Read * * @param asyncContext - Optional. Any state data that is passed to the callback function. */ saveAsync(asyncContext?: any): void; /** * Sets the specified property to the specified value. * * The `set` method sets the specified property to the specified value. To ensure that the set property and value persist on the mail item, * you must call the `saveAsync` method. * * The `set` method creates a new property if the specified property does not already exist; * otherwise, the existing value is replaced with the new value. * The `value` parameter can be of any type; however, it is always passed to the server as a string. * * @remarks * [Api set: Mailbox 1.1] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose or Read * * @param name - The name of the property to be set. * @param value - The value of the property to be set. */ set(name: string, value: string): void; } /** * The `DelayDeliveryTime` object enables you to manage the delayed delivery date and time of a message. * * @remarks * [Api set: Mailbox 1.13] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose */ interface DelayDeliveryTime { /** * Gets the delivery date and time of a message. * * @remarks * [Api set: Mailbox 1.13] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: 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 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. The delivery date and time of a message is returned in the * `asyncResult.value` property. If a delivery date hasn't been set on a message yet, `0` is returned instead. */ getAsync(options: Office.AsyncContextOptions, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Gets the delivery date and time of a message. * * @remarks * [Api set: Mailbox 1.13] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#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, * `asyncResult`, which is an `Office.AsyncResult` object. The delivery date and time of a message is returned in the * `asyncResult.value` property. If a delivery date hasn't been set on a message yet, `0` is returned instead. */ getAsync(callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Sets the delivery date and time of a message. * * @remarks * [Api set: Mailbox 1.13] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read/write item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose * * **Errors**: * * - `InvalidFormatError` - The format of the specified data object is not valid. * * @param datetime - The future date and time when the message should be sent. * @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 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. Any errors encountered will be provided in the `asyncResult.error` property. */ setAsync(datetime: Date, options: Office.AsyncContextOptions, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Sets the delivery date and time of a message. * * @remarks * [Api set: Mailbox 1.13] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read/write item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose * * **Errors**: * * - `InvalidFormatError` - The format of the specified data object is not valid. * * @param datetime - The future date and time when the message should be sent. * @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. Any errors encountered will be provided in the `asyncResult.error` property. */ setAsync(datetime: Date, callback?: (asyncResult: Office.AsyncResult) => void): void; } /** * Provides diagnostic information to an Outlook add-in. * * @remarks * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose or Read * * Starting with Mailbox requirement set 1.5, you can also use the * {@link https://learn.microsoft.com/javascript/api/office/office.context?view=outlook-js-preview&preserve-view=true#office-office-context-diagnostics-member | Office.context.diagnostics} * property to get similar information. */ interface Diagnostics { /** * Gets a string that represents the name of the Office application. * * A string that can be one of the following values: `Outlook`, `OutlookWebApp`, `OutlookIOS`, or `OutlookAndroid`. * * **Note**: The `Outlook` value is returned for Outlook on desktop clients (i.e., Windows and Mac). * * @remarks * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose or Read */ hostName: string; /** * Gets a string that represents the version of either the Office application or the Exchange Server (e.g., "15.0.468.0"). * * If the mail add-in is running in Outlook on a desktop or mobile client, the `hostVersion` property returns the version of the * application, Outlook. In Outlook on the web, the property returns the version of the Exchange Server. * * @remarks * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose or Read */ hostVersion: string; /** * Gets a string that represents the current view of Outlook on the web. * * The returned string can be one of the following values: `OneColumn`, `TwoColumns`, or `ThreeColumns`. * * If the application is not Outlook on the web, then accessing this property results in undefined. * * Outlook on the web has three views that correspond to the width of the screen and the window, and the number of columns that can be displayed: * * - `OneColumn`, which is displayed when the screen is narrow. Outlook on the web uses this single-column layout on the entire screen of a * smartphone. * * - `TwoColumns`, which is displayed when the screen is wider. Outlook on the web uses this view on most tablets. * * - `ThreeColumns`, which is displayed when the screen is wide. For example, Outlook on the web uses this view in a full screen window on a * desktop computer. * * @remarks * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose or Read */ OWAView: MailboxEnums.OWAView | "OneColumn" | "TwoColumns" | "ThreeColumns"; } /** * Provides properties to temporarily set the content displayed in the body or subject of a message in read mode. * * @remarks * [Api set: Mailbox preview] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read/write item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Message Read * * @beta */ interface Display { /** * Gets an object to temporarily set the content displayed in the body of a message in read mode. * * @remarks * [Api set: Mailbox preview] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read/write item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Message Read * * @beta */ body: DisplayedBody; /** * Gets an object to temporarily set the content displayed in the subject of a message in read mode. * * @remarks * [Api set: Mailbox preview] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read/write item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Message Read * * @beta */ subject: DisplayedSubject; } /** * Provides a method to temporarily set the content displayed in the body of a message in read mode. * * @remarks * [Api set: Mailbox preview] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read/write item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Message Read * * @beta */ interface DisplayedBody { /** * Temporarily sets the content displayed in the body of a message in read mode. The set content will remain visible until the user switches to a different messsage or * closes the window of the current message. * * @remarks * [Api set: Mailbox preview] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read/write item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Message Read * * **Recommended**: Call * {@link https://learn.microsoft.com/javascript/api/outlook/office.body#outlook-office-body-gettypeasync-member(1) | Office.context.mailbox.item.body.getTypeAsync}, * then pass the returned value to the `options.coercionType` parameter. * * @param data - The string to be temporarily displayed in the body of a message. The string is limited to 1,000,000 characters. * @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 function. * `coercionType`: The format of the data to be temporarily displayed. The string in the `data` parameter will be converted to this format. * @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. Any errors encountered will be provided in the `asyncResult.error` property. * * @beta */ setAsync(data: string, options: Office.AsyncContextOptions & CoercionTypeOptions, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Temporarily sets the content displayed in the body of a message in read mode. The set content will remain visible until the user switches to a different messsage or * closes the window of the current message. * * @remarks * [Api set: Mailbox preview] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read/write item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Message Read * * @param data - The string to be temporarily displayed in the body of a message. The string is limited to 1,000,000 characters. * @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. Any errors encountered will be provided in the `asyncResult.error` property. * * @beta */ setAsync(data: string, callback?: (asyncResult: Office.AsyncResult) => void): void; } /** * Provides a method to temporarily set the content displayed in the subject of a message in read mode. * * @remarks * [Api set: Mailbox preview] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read/write item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Message Read * * @beta */ interface DisplayedSubject { /** * Temporarily sets the content displayed in the subject of a message in read mode. The set content will remain visible until the user switches to a different messsage or * closes the window of the current message. * * @remarks * [Api set: Mailbox preview] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read/write item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Message Read * * @param data - The string to be temporarily displayed in the subject of a message. The string is limited to 255 characters. * @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 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. Any errors encountered will be provided in the `asyncResult.error` property. */ setAsync(data: string, options: Office.AsyncContextOptions, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Temporarily sets the content displayed in the subject of a message in read mode. The set content will remain visible until the user switches to a different messsage or * closes the window of the current message. * * @remarks * [Api set: Mailbox preview] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read/write item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Message Read * * @param data - The string to be temporarily displayed in the subject of a message. The string is limited to 255 characters. * @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. Any errors encountered will be provided in the `asyncResult.error` property. */ setAsync(data: string, callback?: (asyncResult: Office.AsyncResult) => void): void; } /** * Provides the email properties of the sender or specified recipients of an email message or appointment. * * @remarks * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose or Read */ interface EmailAddressDetails { /** * Gets the SMTP email address. */ emailAddress: string; /** * Gets the display name associated with an email address. */ displayName: string; /** * Gets the response that an attendee returned for an appointment. * This property applies to only an attendee of an appointment, as represented by the `optionalAttendees` or `requiredAttendees` property. * This property returns undefined in other scenarios. */ appointmentResponse: MailboxEnums.ResponseType | string; /** * Gets the email address type of a recipient. * * @remarks * **Important**: A `recipientType` property value isn't returned by the * {@link https://learn.microsoft.com/javascript/api/outlook/office.from?view=outlook-js-preview#outlook-office-from-getasync-member(1) | Office.context.mailbox.item.from.getAsync} * and {@link https://learn.microsoft.com/javascript/api/outlook/office.organizer?view=outlook-js-preview#outlook-office-organizer-getasync-member(1) | Office.context.mailbox.item.organizer.getAsync} methods. * The email sender or appointment organizer is always a user whose email address is on the Exchange server. */ recipientType: MailboxEnums.RecipientType | string; } /** * Represents an email account on an Exchange Server. * * `EmailUser` objects are primarily received in {@link Office.MeetingSuggestion | MeetingSuggestion} and * {@link Office.TaskSuggestion | TaskSuggestion} entities extracted from an Outlook item. To learn more about this scenario, refer to * {@link https://learn.microsoft.com/office/dev/add-ins/outlook/extract-entity-strings-from-an-item | Extract entity strings from an Outlook item}. * * @remarks * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Read */ interface EmailUser { /** * Gets the display name associated with an email address. */ displayName: string; /** * Gets the SMTP email address. */ emailAddress: string; } /** * Represents the set of locations on an appointment. * * @remarks * [Api set: Mailbox 1.8] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose or Read */ export interface EnhancedLocation { /** * Adds to the set of locations associated with the appointment. * * @remarks * [Api set: Mailbox 1.8] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read/write item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose * * **Errors**: * * - `InvalidFormatError`: The format of the specified data object is not valid. * * @param locationIdentifiers The locations to be added to the current list of locations. * @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 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. Check the `status` property of `asyncResult` to determine if the call succeeded. */ addAsync(locationIdentifiers: LocationIdentifier[], options: Office.AsyncContextOptions, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Adds to the set of locations associated with the appointment. * * @remarks * [Api set: Mailbox 1.8] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read/write item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose * * **Errors**: * * - `InvalidFormatError`: The format of the specified data object is not valid. * * @param locationIdentifiers The locations to be added to the current list of locations. * @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. Check the `status` property of `asyncResult` to determine if the call succeeded. */ addAsync(locationIdentifiers: LocationIdentifier[], callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Gets the set of locations associated with the appointment. * * **Note**: {@link https://support.microsoft.com/office/88ff6c60-0a1d-4b54-8c9d-9e1a71bc3023 | Personal contact groups} * added as appointment locations aren't returned by this method. * * @remarks * [Api set: Mailbox 1.8] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#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 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. */ getAsync(options: Office.AsyncContextOptions, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Gets the set of locations associated with the appointment. * * **Note**: {@link https://support.microsoft.com/office/88ff6c60-0a1d-4b54-8c9d-9e1a71bc3023 | Personal contact groups} * added as appointment locations aren't returned by this method. * * @remarks * [Api set: Mailbox 1.8] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#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. */ getAsync(callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Removes the set of locations associated with the appointment. * * If there are multiple locations with the same name, all matching locations will be removed even if only one was specified in `locationIdentifiers`. * * @remarks * [Api set: Mailbox 1.8] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read/write item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose * * @param locationIdentifiers The locations to be removed from the current list of locations. * @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 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. Check the `status` property of `asyncResult` to determine if the call succeeded. */ removeAsync(locationIdentifiers: LocationIdentifier[], options: Office.AsyncContextOptions, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Removes the set of locations associated with the appointment. * * If there are multiple locations with the same name, all matching locations will be removed even if only one was specified in `locationIdentifiers`. * * @remarks * [Api set: Mailbox 1.8] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read/write item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose * * @param locationIdentifiers The locations to be removed from the current list of locations. * @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. Check the `status` property of `asyncResult` to determine if the call succeeded. */ removeAsync(locationIdentifiers: LocationIdentifier[], callback?: (asyncResult: Office.AsyncResult) => void): void; } /** * Provides the current enhanced locations when the `Office.EventType.EnhancedLocationsChanged` event is raised. * * @remarks * [Api set: Mailbox 1.8] */ export interface EnhancedLocationsChangedEventArgs { /** * Gets the set of enhanced locations. * * @remarks * [Api set: Mailbox 1.8] */ enhancedLocations: LocationDetails[]; /** * Gets the type of the event. For details, refer to {@link https://learn.microsoft.com/javascript/api/office/office.eventtype | Office.EventType}. * * @remarks * [Api set: Mailbox 1.8] */ type: "olkEnhancedLocationsChanged"; } /** * Represents a collection of entities found in an email message or appointment. Read mode only. * * The `Entities` object is a container for the entity arrays returned by the `getEntities` and `getEntitiesByType` methods when the item * (either an email message or an appointment) contains one or more entities that have been found by the server. * You can use these entities in your code to provide additional context information to the viewer, such as a map to an address found in the item, * or to open a dialer for a phone number found in the item. * * If no entities of the type specified in the property are present in the item, the property associated with that entity is null. * For example, if a message contains a street address and a phone number, the addresses property and phoneNumbers property would contain * information, and the other properties would be null. * * To be recognized as an address, the string must contain a United States postal address that has at least a subset of the elements of a street * number, street name, city, state, and zip code. * * To be recognized as a phone number, the string must contain a North American phone number format. * * Entity recognition relies on natural language recognition that is based on machine learning of large amounts of data. * The recognition of an entity is non-deterministic and success sometimes relies on the particular context in the item. * * When the property arrays are returned by the `getEntitiesByType` method, only the property for the specified entity contains data; * all other properties are null. * * @remarks * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Read */ interface Entities { /** * Gets the physical addresses (street or mailing addresses) found in an email message or appointment. */ addresses: string[]; /** * Gets the contacts found in an email address or appointment. */ contacts: Contact[]; /** * Gets the email addresses found in an email message or appointment. */ emailAddresses: string[]; /** * Gets the meeting suggestions found in an email message. */ meetingSuggestions: MeetingSuggestion[]; /** * Gets the phone numbers found in an email message or appointment. */ phoneNumbers: PhoneNumber[]; /** * Gets the task suggestions found in an email message or appointment. */ taskSuggestions: string[]; /** * Gets the Internet URLs present in an email message or appointment. */ urls: string[]; } /** * Provides a method to get the from value of a message in an Outlook add-in. * * @remarks * [Api set: Mailbox 1.7] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose * * **Important**: This interface is supported in Outlook on Android and on iOS. For a sample scenario, see * {@link https://learn.microsoft.com/office/dev/add-ins/outlook/mobile-event-based | Implement event-based activation in Outlook mobile add-ins}. */ interface From { /** * Gets the from value of a message. * * The `getAsync` method starts an asynchronous call to the Exchange server to get the from value of a message. * * The from value of the item is provided as an {@link Office.EmailAddressDetails | EmailAddressDetails} in the `asyncResult.value` property. * * @remarks * [Api set: Mailbox 1.7] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose * * **Important**: * * - This method is supported in Outlook on Android and on iOS. For a sample scenario, see * {@link https://learn.microsoft.com/office/dev/add-ins/outlook/mobile-event-based | Implement event-based activation in Outlook mobile add-ins}. * To learn more about APIs supported in Outlook mobile, see * {@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-mobile-apis | Outlook JavaScript APIs supported in Outlook on mobile devices}. * * - A `recipientType` property value isn't returned by the `getAsync` method. * The email sender is always a user whose email address is on the Exchange server. * * @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 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. * The `value` property of the result is the item's from value, as an `EmailAddressDetails` object. */ getAsync(options: Office.AsyncContextOptions, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Gets the from value of a message. * * The `getAsync` method starts an asynchronous call to the Exchange server to get the from value of a message. * * The from value of the item is provided as an {@link Office.EmailAddressDetails | EmailAddressDetails} in the `asyncResult.value` property. * * @remarks * [Api set: Mailbox 1.7] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose * * **Important**: * * - This method is supported in Outlook on Android and on iOS. For a sample scenario, see * {@link https://learn.microsoft.com/office/dev/add-ins/outlook/mobile-event-based | Implement event-based activation in Outlook mobile add-ins}. * To learn more about APIs supported in Outlook mobile, see * {@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-mobile-apis | Outlook JavaScript APIs supported in Outlook on mobile devices}. * * - A `recipientType` property value isn't returned by the `getAsync` method. * The email sender is always a user whose email address is on the Exchange server. * * @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. * The `value` property of the result is the item's from value, as an `EmailAddressDetails` object. */ getAsync(callback?: (asyncResult: Office.AsyncResult) => void): void; } /** * Provides basic details about the notification message that raised the `Office.EventType.InfobarClicked` event. * * @remarks * [Api set: Mailbox 1.10] */ interface InfobarClickedEventArgs { /** * Gets additional details about the notification message. * * @remarks * [Api set: Mailbox 1.10] */ infobarDetails: InfobarDetails; /** * Gets the type of the event. For details, refer to {@link https://learn.microsoft.com/javascript/api/office/office.eventtype | Office.EventType}. * * @remarks * [Api set: Mailbox 1.10] */ type: "olkInfobarClicked"; } /** * Provides additional details about the notification message that raised the `Office.EventType.InfobarClicked` event. * * @remarks * [Api set: Mailbox 1.10] */ interface InfobarDetails { /** * The action type. Currently, "Dismiss" is the only supported action. * * @remarks * [Api set: Mailbox 1.10] */ actionType: MailboxEnums.InfobarActionType; /** * The notification type. * * @remarks * [Api set: Mailbox 1.10] */ infobarType: MailboxEnums.InfobarType; } /** * The `InternetHeaders` object represents custom internet headers that are preserved after the message item leaves Exchange * and is converted to a MIME message. * * Internet headers are stored as string key-value pairs on a per-item basis. * * **Note**: This object is intended for you to set and get your custom headers on a message item. To learn more, see * {@link https://learn.microsoft.com/office/dev/add-ins/outlook/internet-headers | Get and set internet headers on a message in an Outlook add-in}. * * @remarks * [Api set: Mailbox 1.8] * * **Recommended practices** * * Currently, internet headers are a finite resource on a user's mailbox. When the quota is exhausted, you can't create any more internet headers * on that mailbox, which can result in unexpected behavior from clients that rely on this to function. * * Apply the following guidelines when you create internet headers in your add-in. * * - Create the minimum number of headers required. The header quota is based on the total size of headers applied to a message. In Exchange Online, * the header limit is capped at 256 KB, while in an Exchange on-premises environment, the limit is determined by your organization's administrator. * For further information on header limits, see * {@link https://learn.microsoft.com/office365/servicedescriptions/exchange-online-service-description/exchange-online-limits#message-limits | Exchange Online message limits} * and {@link https://learn.microsoft.com/exchange/mail-flow/message-size-limits?view=exchserver-2019#types-of-message-size-limits | Exchange Server message limits}. * * - Name headers so that you can reuse and update their values later. As such, avoid naming headers in a variable manner * (for example, based on user input, timestamp, etc.). * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose */ interface InternetHeaders { /** * Given an array of internet header names, this method returns a record containing those internet headers and their values. * If the add-in requests a header that isn't available, that header won't be returned in the results. * * **Note**: This method is intended to return the values of the custom headers you set using the `setAsync` method. * * @remarks * [Api set: Mailbox 1.8] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose * * @param names - The names of the internet headers to be returned. * @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 function. * @param callback - When the method completes, the function passed in the `callback` parameter is called with a single parameter, * `asyncResult`, of type `Office.AsyncResult`. The string key-value pairs of internet headers are returned in the * `asyncResult.value` property. Any errors encountered are provided in the `asyncResult.error` property. */ getAsync(names: string[], options: Office.AsyncContextOptions, callback: (asyncResult: Office.AsyncResult>) => void): void; /** * Given an array of internet header names, this method returns a record containing those internet headers and their values. * If the add-in requests a header that isn't available, that header won't be returned in the results. * * **Note**: This method is intended to return the values of the custom headers you set using the `setAsync` method. * * @remarks * [Api set: Mailbox 1.8] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose * * @param names - The names of the internet headers to be returned. * @param callback - When the method completes, the function passed in the `callback` parameter is called with a single parameter, * `asyncResult`, of type `Office.AsyncResult`. The string key-value pairs of internet headers are returned in the * `asyncResult.value` property. Any errors encountered are provided in the `asyncResult.error` property. */ getAsync(names: string[], callback: (asyncResult: Office.AsyncResult>) => void): void; /** * Given an array of internet header names, this method removes the specified headers from the internet header collection. * * **Note**: This method is intended to remove the custom headers you set using the `setAsync` method. * * @remarks * [Api set: Mailbox 1.8] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read/write item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose * * @param names - The names of the internet headers to be removed. * @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 function. * @param callback - Optional. When the method completes, the function passed in the `callback` parameter is called with a single parameter, * `asyncResult`, of type `Office.AsyncResult`. Any errors encountered are provided in the `asyncResult.error` property. */ removeAsync(names: string[], options: Office.AsyncContextOptions, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Given an array of internet header names, this method removes the specified headers from the internet header collection. * * **Note**: This method is intended to remove the custom headers you set using the `setAsync` method. * * @remarks * [Api set: Mailbox 1.8] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read/write item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose * * @param names - The names of the internet headers to be removed. * @param callback - Optional. When the method completes, the function passed in the `callback` parameter is called with a single parameter, * `asyncResult`, of type `Office.AsyncResult`. Any errors encountered are provided in the `asyncResult.error` property. */ removeAsync(names: string[], callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Sets the specified internet headers to the specified values. * * The `setAsync` method creates a new header if the specified header doesn't already exist; otherwise, the existing value is replaced with * the new value. * * **Note**: This method is intended to set the values of your custom headers. * * **Important**: The header quota is based on the total size of headers applied to a message. In Exchange Online, * the header limit is capped at 256 KB, while in an Exchange on-premises environment, the limit is determined by your organization's administrator. * For further information on header limits, see * {@link https://learn.microsoft.com/office365/servicedescriptions/exchange-online-service-description/exchange-online-limits#message-limits | Exchange Online message limits} * and {@link https://learn.microsoft.com/exchange/mail-flow/message-size-limits?view=exchserver-2019#types-of-message-size-limits | Exchange Server message limits}. * * @remarks * [Api set: Mailbox 1.8] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read/write item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose * * @param headers - The names and corresponding values of the headers to be set. This should be a record object with its keys being internet header names * and values being the corresponding header value strings. * @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 function. * @param callback - Optional. When the method completes, the function passed in the `callback` parameter is called with a single parameter, * `asyncResult`, of type `Office.AsyncResult`. Any errors encountered are provided in the `asyncResult.error` property. */ setAsync(headers: Record, options: Office.AsyncContextOptions, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Sets the specified internet headers to the specified values. * * The `setAsync` method creates a new header if the specified header doesn't already exist; otherwise, the existing value is replaced with * the new value. * * **Note**: This method is intended to set the values of your custom headers. * * **Important**: The header quota is based on the total size of headers applied to a message. In Exchange Online, * the header limit is capped at 256 KB, while in an Exchange on-premises environment, the limit is determined by your organization's administrator. * For further information on header limits, see * {@link https://learn.microsoft.com/office365/servicedescriptions/exchange-online-service-description/exchange-online-limits#message-limits | Exchange Online message limits} * and {@link https://learn.microsoft.com/exchange/mail-flow/message-size-limits?view=exchserver-2019#types-of-message-size-limits | Exchange Server message limits}. * * @remarks * [Api set: Mailbox 1.8] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read/write item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose * * @param headers - The names and corresponding values of the headers to be set. This should be a record object with its keys being internet header names * and values being the corresponding header value strings. * @param callback - Optional. When the method completes, the function passed in the `callback` parameter is called with a single parameter, * `asyncResult`, of type `Office.AsyncResult`. Any errors encountered are provided in the `asyncResult.error` property. */ setAsync(headers: Record, callback?: (asyncResult: Office.AsyncResult) => void): void; } /** * 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. * * To see the full member list, refer to the * {@link https://learn.microsoft.com/javascript/api/requirement-sets/outlook/preview-requirement-set/office.context.mailbox.item | Object Model} page. * * If you want to see IntelliSense for only a specific type or mode, cast this item to one of the following: * * - {@link Office.AppointmentCompose | AppointmentCompose} * * - {@link Office.AppointmentRead | AppointmentRead} * * - {@link Office.MessageCompose | MessageCompose} * * - {@link Office.MessageRead | MessageRead} * * @remarks * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **restricted** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Appointment Organizer, Appointment Attendee, Message Compose, Message Read */ interface Item { } /** * The compose mode of {@link Office.Item | Office.context.mailbox.item}. * * **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`. For more information, refer to the * {@link https://learn.microsoft.com/javascript/api/requirement-sets/outlook/preview-requirement-set/office.context.mailbox.item | Object Model} page. * * Child interfaces: * * - {@link Office.AppointmentCompose | AppointmentCompose} * * - {@link Office.MessageCompose | MessageCompose} */ interface ItemCompose extends Item { } /** * The read mode of {@link Office.Item | Office.context.mailbox.item}. * * **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`. For more information, refer to the * {@link https://learn.microsoft.com/javascript/api/requirement-sets/outlook/preview-requirement-set/office.context.mailbox.item | Object Model} page. * * Child interfaces: * * - {@link Office.AppointmentRead | AppointmentRead} * * - {@link Office.MessageRead | MessageRead} */ interface ItemRead extends Item { } /** * Represents a date and time in the local client's time zone. Read mode only. * * @remarks * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Read */ interface LocalClientTime { /** * Integer value representing the month, beginning with 0 for January to 11 for December. */ month: number; /** * Integer value representing the day of the month. */ date: number; /** * Integer value representing the year. */ year: number; /** * Integer value representing the hour on a 24-hour clock. */ hours: number; /** * Integer value representing the minutes. */ minutes: number; /** * Integer value representing the seconds. */ seconds: number; /** * Integer value representing the milliseconds. */ milliseconds: number; /** * Integer value representing the number of minutes difference between the local time zone and UTC. */ timezoneOffset: number; } /** * Provides methods to get and set the location of a meeting in an Outlook add-in. * * @remarks * [Api set: Mailbox 1.1] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose */ interface Location { /** * Gets the location of an appointment. * * The `getAsync` method starts an asynchronous call to the Exchange server to get the location of an appointment. * The location of the appointment is provided as a string in the `asyncResult.value` property. * * @remarks * [Api set: Mailbox 1.1] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: 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 function. * @param callback - When the method completes, the function passed in the `callback` parameter is called with a single parameter of * type `Office.AsyncResult`. */ getAsync(options: Office.AsyncContextOptions, callback: (asyncResult: Office.AsyncResult) => void): void; /** * Gets the location of an appointment. * * The `getAsync` method starts an asynchronous call to the Exchange server to get the location of an appointment. * The location of the appointment is provided as a string in the `asyncResult.value` property. * * @remarks * [Api set: Mailbox 1.1] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose * * @param callback - When the method completes, the function passed in the `callback` parameter is called with a single parameter of * type `Office.AsyncResult`. */ getAsync(callback: (asyncResult: Office.AsyncResult) => void): void; /** * Sets the location of an appointment. * * The `setAsync` method starts an asynchronous call to the Exchange server to set the location of an appointment. * Setting the location of an appointment overwrites the current location. * * @remarks * [Api set: Mailbox 1.1] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose * * **Errors**: * * - DataExceedsMaximumSize: The location parameter is longer than 255 characters. * * @param location - The location of the appointment. The string is limited to 255 characters. * @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 function. * @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 setting the location fails, the `asyncResult.error` property will contain an error code. */ setAsync(location: string, options: Office.AsyncContextOptions, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Sets the location of an appointment. * * The `setAsync` method starts an asynchronous call to the Exchange server to set the location of an appointment. * Setting the location of an appointment overwrites the current location. * * @remarks * [Api set: Mailbox 1.1] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose * * **Errors**: * * - DataExceedsMaximumSize: The location parameter is longer than 255 characters. * * @param location - The location of the appointment. The string is limited to 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`. If setting the location fails, the `asyncResult.error` property will contain an error code. */ setAsync(location: string, callback?: (asyncResult: Office.AsyncResult) => void): void; } /** * Represents a location. Read-only. * * @remarks * [Api set: Mailbox 1.8] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose or Read */ export interface LocationDetails { /** * The `LocationIdentifier` of the location. */ locationIdentifier: LocationIdentifier; /** * The location's display name. */ displayName: string; /** * The email address associated with the location. Only locations of type `Room` have an email address. */ emailAddress: string; } /** * Represents the ID of a location. * * @remarks * [Api set: Mailbox 1.8] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose or Read */ interface LocationIdentifier { /** * The location's unique ID. * * For `Room` type, it's the room's email address. * * For `Custom` type, it's the `displayName`. */ id: string; /** * The location's type. */ type: MailboxEnums.LocationType | string; } /** * Provides access to the Microsoft Outlook add-in object model. * * Key properties: * * - `diagnostics`: Provides diagnostic information to an Outlook add-in. * * - `item`: Provides methods and properties for accessing a message or appointment in an Outlook add-in. * * - `userProfile`: Provides information about the user in an Outlook add-in. * * @remarks * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **restricted** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose or Read */ interface Mailbox { /** * Provides diagnostic information to an Outlook add-in. * * Contains the following members. * * - `hostName` (string): A string that represents the name of the Office application. * It should be one of the following values: `Outlook`, `OutlookWebApp`, `OutlookIOS`, or `OutlookAndroid`. * **Note**: The "Outlook" value is returned for Outlook on desktop clients (i.e., Windows and Mac). * * - `hostVersion` (string): A string that represents the version of either the Office application or the Exchange Server (e.g., "15.0.468.0"). * If the mail add-in is running in Outlook on desktop or mobile clients, the `hostVersion` property returns the version of the * application, Outlook. In Outlook on the web, the property returns the version of the Exchange Server. * * - `OWAView` (`MailboxEnums.OWAView` or string): An enum (or string literal) that represents the current view of Outlook on the web. * If the application is not Outlook on the web, then accessing this property results in undefined. * Outlook on the web has three views (`OneColumn` - displayed when the screen is narrow, `TwoColumns` - displayed when the screen is wider, * and `ThreeColumns` - displayed when the screen is wide) that correspond to the width of the screen and the window, and the number of columns * that can be displayed. * * More information is under {@link Office.Diagnostics}. * * @remarks * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose or Read * * Starting with Mailbox requirement set 1.5, you can also use the * {@link https://learn.microsoft.com/javascript/api/office/office.context?view=outlook-js-preview&preserve-view=true#office-office-context-diagnostics-member | Office.context.diagnostics} * property to get similar information. */ diagnostics: Diagnostics; /** * Gets the URL of the Exchange Web Services (EWS) endpoint for this email account. * * @remarks * [Api set: Mailbox 1.1] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose or Read * * **Important**: * * - Your app must have the **read item** permission specified in its manifest to call the `ewsUrl` member in read mode. * * - In compose mode, you must call the `saveAsync` method before you can use the `ewsUrl` member. * Your app must have **read/write item** permissions to call the `saveAsync` method. * * - This property isn't supported in Outlook on Android or on iOS. For more information on supported APIs in Outlook mobile, see * {@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-mobile-apis | Outlook JavaScript APIs supported in Outlook on mobile devices}. * * - The `ewsUrl` value can be used by a remote service to make EWS calls to the user's mailbox. * For example, you can create a remote service to {@link https://learn.microsoft.com/office/dev/add-ins/outlook/get-attachments-of-an-outlook-item | get attachments from the selected item}. */ ewsUrl: string; /** * The mailbox item. Depending on the context in which the add-in opened, the item type may vary. * If you want to see IntelliSense for only a specific type or mode, cast this item to one of the following: * * {@link Office.MessageCompose | MessageCompose}, {@link Office.MessageRead | MessageRead}, * {@link Office.AppointmentCompose | AppointmentCompose}, {@link Office.AppointmentRead | AppointmentRead} * * **Important**: `item` can be null if your add-in supports pinning the task pane. For details on how to handle, see * {@link https://learn.microsoft.com/office/dev/add-ins/outlook/pinnable-taskpane#implement-the-event-handler | Implement a pinnable task pane in Outlook}. */ item?: Item & ItemCompose & ItemRead & Message & MessageCompose & MessageRead & Appointment & AppointmentCompose & AppointmentRead; /** * Gets an object that provides methods to manage the categories master list associated with a mailbox. * * @remarks * [Api set: Mailbox 1.8] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read/write mailbox** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose or Read */ masterCategories: MasterCategories; /** * Gets the URL of the REST endpoint for this email account. * * Your app must have the **read item** permission specified in its manifest to call the `restUrl` member in read mode. * * In compose mode you must call the `saveAsync` method before you can use the `restUrl` member. * Your app must have **read/write item** permissions to call the `saveAsync` method. * * However, in delegate or shared scenarios, you should instead use the `targetRestUrl` property of the * {@link Office.SharedProperties | SharedProperties} object (introduced in requirement set 1.8). For more information, * see the {@link https://learn.microsoft.com/office/dev/add-ins/outlook/delegate-access | shared folders and shared mailbox} article. * * @remarks * [Api set: Mailbox 1.5] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose or Read * * The `restUrl` value can be used to make {@link https://learn.microsoft.com/outlook/rest/ | REST API} calls to the user's mailbox. */ restUrl: string; /** * Information about the user associated with the mailbox. This includes their account type, display name, email address, and time zone. * * More information is under {@link Office.UserProfile} */ userProfile: UserProfile; /** * Adds an event handler for a supported event. **Note**: Events are only available with task pane implementation. * * For supported events, refer to the Mailbox object model * {@link https://learn.microsoft.com/javascript/api/requirement-sets/outlook/preview-requirement-set/office.context.mailbox#events | events section}. * * @remarks * [Api set: Mailbox 1.5] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#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 - Provides an option for preserving context data of any type, unchanged, for use in a callback. * @param callback - Optional. When the method completes, the function passed in the `callback` parameter is called with a single parameter of * type `Office.AsyncResult`. */ 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 only available with task pane implementation. * * For supported events, refer to the Mailbox object model * {@link https://learn.microsoft.com/javascript/api/requirement-sets/outlook/preview-requirement-set/office.context.mailbox#events | events section}. * * @remarks * [Api set: Mailbox 1.5] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#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 of * type `Office.AsyncResult`. */ addHandlerAsync(eventType: Office.EventType | string, handler: any, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Converts an item ID formatted for REST into EWS format. * * Item IDs retrieved via a REST API (such as the Outlook Mail API or the Microsoft Graph) use a different format than the format used by * Exchange Web Services (EWS). The `convertToEwsId` method converts a REST-formatted ID into the proper format for EWS. * * @remarks * [Api set: Mailbox 1.3] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **restricted** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose or Read * * **Important**: This method isn't supported in Outlook on Android or on iOS. For more information on supported APIs in Outlook mobile, see * {@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-mobile-apis | Outlook JavaScript APIs supported in Outlook on mobile devices}. * * @param itemId - An item ID formatted for the Outlook REST APIs. * @param restVersion - A value indicating the version of the Outlook REST API used to retrieve the item ID. */ convertToEwsId(itemId: string, restVersion: MailboxEnums.RestVersion | string): string; /** * Gets a dictionary containing time information in local client time. * * The dates and times used by a mail app for Outlook on the web or desktop clients can use different time zones. * Outlook uses the client computer time zone; Outlook on the web uses the time zone set on the Exchange Admin Center (EAC). * You should handle date and time values so that the values you display on the user interface are always consistent with the time zone that * the user expects. * * If the mail app is running in Outlook on desktop clients, the `convertToLocalClientTime` method will return a dictionary object * with the values set to the client computer time zone. * If the mail app is running in Outlook on the web, the `convertToLocalClientTime` method will return a dictionary object * with the values set to the time zone specified in the EAC. * * @remarks * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose or Read * * @param timeValue - A `Date` object. */ convertToLocalClientTime(timeValue: Date): LocalClientTime; /** * Converts an item ID formatted for EWS into REST format. * * @remarks * [Api set: Mailbox 1.3] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **restricted** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose or Read * * **Important**: * * - This method isn't supported in Outlook on Android or on iOS. For more information on supported APIs in Outlook mobile, see * {@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-mobile-apis | Outlook JavaScript APIs supported in Outlook on mobile devices}. * * - Item IDs retrieved via EWS or via the `itemId` property use a different format than the format used by REST APIs (such as the * {@link https://learn.microsoft.com/previous-versions/office/office-365-api/api/version-2.0/mail-rest-operations | Outlook Mail API} * or the {@link https://graph.microsoft.io/ | Microsoft Graph}. * The `convertToRestId` method converts an EWS-formatted ID into the proper format for REST. * * @param itemId - An item ID formatted for Exchange Web Services (EWS) * @param restVersion - A value indicating the version of the Outlook REST API that the converted ID will be used with. */ convertToRestId(itemId: string, restVersion: MailboxEnums.RestVersion | string): string; /** * Gets a `Date` object from a dictionary containing time information. * * The `convertToUtcClientTime` method converts a dictionary containing a local date and time to a `Date` object with the correct values for the * local date and time. * * @returns A Date object with the time expressed in UTC. * * @remarks * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose or Read * * @param input - The local time value to convert. */ convertToUtcClientTime(input: LocalClientTime): Date; /** * Displays an existing calendar appointment. * * The `displayAppointmentForm` method opens an existing calendar appointment in a new window on the desktop. * * In Outlook on Mac, you can use this method to display a single appointment that isn't part of a recurring series, or the master appointment * of a recurring series. However, you can't display an instance of the series because you can't access the properties * (including the item ID) of instances of a recurring series. * * In Outlook on the web, this method opens the specified form only if the body of the form is less than or equal to 32K characters. * * If the specified item identifier does not identify an existing appointment, a blank pane opens on the client computer or device, and * no error message is returned. * * @remarks * [Api set: Mailbox 1.1] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose or Read * * **Important**: This method isn't supported in Outlook on Android or on iOS. For more information on supported APIs in Outlook mobile, see * {@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-mobile-apis | Outlook JavaScript APIs supported in Outlook on mobile devices}. * * @param itemId - The Exchange Web Services (EWS) identifier for an existing calendar appointment. */ displayAppointmentForm(itemId: string): void; /** * Displays an existing calendar appointment. * * The `displayAppointmentFormAsync` method opens an existing calendar appointment in a new window on the desktop or in a dialog box on * mobile devices. * * In Outlook on Mac, you can use this method to display a single appointment that is not part of a recurring series, or the master appointment * of a recurring series. However, you can't display an instance of the series because you can't access the properties * (including the item ID) of instances of a recurring series. * * In Outlook on the web, this method opens the specified form only if the body of the form is less than or equal to 32K characters. * * If the specified item identifier does not identify an existing appointment, a blank pane opens on the client computer or device, and * no error message is returned. * * **Note**: This method is not supported in Outlook on iOS or Android. * * @remarks * [Api set: Mailbox 1.9] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose or Read * * @param itemId - The Exchange Web Services (EWS) identifier for an existing calendar appointment. * @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 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. */ displayAppointmentFormAsync(itemId: string, options: Office.AsyncContextOptions, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Displays an existing calendar appointment. * * The `displayAppointmentFormAsync` method opens an existing calendar appointment in a new window on the desktop or in a dialog box on * mobile devices. * * In Outlook on Mac, you can use this method to display a single appointment that is not part of a recurring series, or the master appointment * of a recurring series. However, you can't display an instance of the series because you can't access the properties * (including the item ID) of instances of a recurring series. * * In Outlook on the web, this method opens the specified form only if the body of the form is less than or equal to 32K characters. * * If the specified item identifier does not identify an existing appointment, a blank pane opens on the client computer or device, and * no error message is returned. * * **Note**: This method is not supported in Outlook on iOS or Android. * * @remarks * [Api set: Mailbox 1.9] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose or Read * * @param itemId - The Exchange Web Services (EWS) identifier for an existing calendar appointment. * @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. */ displayAppointmentFormAsync(itemId: string, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Displays an existing message. * * The `displayMessageForm` method opens an existing message in a new window on the desktop. * * In Outlook on the web, this method opens the specified form only if the body of the form is less than or equal to 32K characters. * * If the specified item identifier doesn't identify an existing message, no message will be displayed on the client computer, and * no error message is returned. * * @remarks * [Api set: Mailbox 1.1] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose or Read * * **Important**: * * - This method isn't supported in Outlook on Android or on iOS. For more information on supported APIs in Outlook mobile, see * {@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-mobile-apis | Outlook JavaScript APIs supported in Outlook on mobile devices}. * * - Don't use the `displayMessageForm` with an itemId that represents an appointment. Use the `displayAppointmentForm` method to display * an existing appointment, and `displayNewAppointmentForm` to display a form to create a new appointment. * * @param itemId - The Exchange Web Services (EWS) identifier for an existing message. */ displayMessageForm(itemId: string): void; /** * Displays an existing message. * * The `displayMessageFormAsync` method opens an existing message in a new window on the desktop or in a dialog box on mobile devices. * * In Outlook on the web, this method opens the specified form only if the body of the form is less than or equal to 32K characters. * * If the specified item identifier does not identify an existing message, no message will be displayed on the client computer, and * no error message is returned. * * Do not use the `displayMessageForm` or `displayMessageFormAsync` method with an itemId that represents an appointment. * Use the `displayAppointmentForm` or `displayAppointmentFormAsync` method to display an existing appointment, * and `displayNewAppointmentForm` or `displayNewAppointmentFormAsync` to display a form to create a new appointment. * * **Note**: This method is not supported in Outlook on iOS or Android. * * @remarks * [Api set: Mailbox 1.9] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose or Read * * @param itemId - The Exchange Web Services (EWS) identifier for an existing message. * @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 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. */ displayMessageFormAsync(itemId: string, options: Office.AsyncContextOptions, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Displays an existing message. * * The `displayMessageFormAsync` method opens an existing message in a new window on the desktop or in a dialog box on mobile devices. * * In Outlook on the web, this method opens the specified form only if the body of the form is less than or equal to 32K characters. * * If the specified item identifier does not identify an existing message, no message will be displayed on the client computer, and * no error message is returned. * * Do not use the `displayMessageForm` or `displayMessageFormAsync` method with an itemId that represents an appointment. * Use the `displayAppointmentForm` or `displayAppointmentFormAsync` method to display an existing appointment, * and `displayNewAppointmentForm` or `displayNewAppointmentFormAsync` to display a form to create a new appointment. * * **Note**: This method is not supported in Outlook on iOS or Android. * * @remarks * [Api set: Mailbox 1.9] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose or Read * * @param itemId - The Exchange Web Services (EWS) identifier for an existing message. * @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. */ displayMessageFormAsync(itemId: string, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Displays a form for creating a new calendar appointment. * * The `displayNewAppointmentForm` method opens a form that enables the user to create a new appointment or meeting. * If parameters are specified, the appointment form fields are automatically populated with the contents of the parameters. * * In Outlook on the web, this method always displays a form with an attendees field. * If you don't specify any attendees as input arguments, the method displays a form with a **Save** button. * If you have specified attendees, the form would include the attendees and a **Send** button. * * In the Outlook rich client and Outlook RT, if you specify any attendees or resources in the `requiredAttendees`, `optionalAttendees`, or * `resources` parameter, this method displays a meeting form with a **Send** button. * If you don't specify any recipients, this method displays an appointment form with a **Save & Close** button. * * If any of the parameters exceed the specified size limits, or if an unknown parameter name is specified, an exception is thrown. * * @remarks * [Api set: Mailbox 1.1] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Read * * **Important**: This method isn't supported in Outlook on Android or on iOS. For more information on supported APIs in Outlook mobile, see * {@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-mobile-apis | Outlook JavaScript APIs supported in Outlook on mobile devices}. * * @param parameters - An `AppointmentForm` describing the new appointment. All properties are optional. */ displayNewAppointmentForm(parameters: AppointmentForm): void; /** * Displays a form for creating a new calendar appointment. * * The `displayNewAppointmentFormAsync` method opens a form that enables the user to create a new appointment or meeting. * If parameters are specified, the appointment form fields are automatically populated with the contents of the parameters. * * In Outlook on the web, this method always displays a form with an attendees field. * If you do not specify any attendees as input arguments, the method displays a form with a **Save** button. * If you have specified attendees, the form would include the attendees and a **Send** button. * * In the Outlook rich client and Outlook RT, if you specify any attendees or resources in the `requiredAttendees`, `optionalAttendees`, or * `resources` parameter, this method displays a meeting form with a **Send** button. * If you don't specify any recipients, this method displays an appointment form with a **Save & Close** button. * * If any of the parameters exceed the specified size limits, or if an unknown parameter name is specified, an exception is thrown. * * **Note**: This method is not supported in Outlook on iOS or Android. * * @remarks * [Api set: Mailbox 1.9] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Read * * @param parameters - An `AppointmentForm` describing the new appointment. All properties are optional. * @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 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. */ displayNewAppointmentFormAsync(parameters: AppointmentForm, options: Office.AsyncContextOptions, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Displays a form for creating a new calendar appointment. * * The `displayNewAppointmentFormAsync` method opens a form that enables the user to create a new appointment or meeting. * If parameters are specified, the appointment form fields are automatically populated with the contents of the parameters. * * In Outlook on the web, this method always displays a form with an attendees field. * If you do not specify any attendees as input arguments, the method displays a form with a **Save** button. * If you have specified attendees, the form would include the attendees and a **Send** button. * * In the Outlook rich client and Outlook RT, if you specify any attendees or resources in the `requiredAttendees`, `optionalAttendees`, or * `resources` parameter, this method displays a meeting form with a **Send** button. * If you don't specify any recipients, this method displays an appointment form with a **Save & Close** button. * * If any of the parameters exceed the specified size limits, or if an unknown parameter name is specified, an exception is thrown. * * **Note**: This method is not supported in Outlook on iOS or Android. * * @remarks * [Api set: Mailbox 1.9] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Read * * @param parameters - An `AppointmentForm` describing the new appointment. All properties are optional. * @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. */ displayNewAppointmentFormAsync(parameters: AppointmentForm, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Displays a form for creating a new message. * * The `displayNewMessageForm` method opens a form that enables the user to create a new message. If parameters are specified, the message form * fields are automatically populated with the contents of the parameters. * * If any of the parameters exceed the specified size limits, or if an unknown parameter name is specified, an exception is thrown. * * @remarks * [Api set: Mailbox 1.6] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Read * * @param parameters - A dictionary containing all values to be filled in for the user in the new form. All parameters are optional. * * `toRecipients`: An array of strings containing the email addresses or an array containing an {@link Office.EmailAddressDetails | EmailAddressDetails} object * for each of the recipients on the **To** line. The array is limited to a maximum of 100 entries. * * `ccRecipients`: An array of strings containing the email addresses or an array containing an {@link Office.EmailAddressDetails | EmailAddressDetails} object * for each of the recipients on the **Cc** line. The array is limited to a maximum of 100 entries. * * `bccRecipients`: An array of strings containing the email addresses or an array containing an {@link Office.EmailAddressDetails | EmailAddressDetails} object * for each of the recipients on the **Bcc** line. The array is limited to a maximum of 100 entries. * * `subject`: A string containing the subject of the message. The string is limited to a maximum of 255 characters. * * `htmlBody`: The HTML body of the message. The body content is limited to a maximum size of 32 KB. * * `attachments`: An array of JSON objects that are either file or item attachments. * * `attachments.type`: Indicates the type of attachment. Must be file for a file attachment or item for an item attachment. * * `attachments.name`: A string that contains the name of the attachment, up to 255 characters in length. * * `attachments.url`: Only used if type is set to file. The URI of the location for the file. **Important**: This link must be * publicly accessible, without need for authentication by Exchange Online servers. However, with on-premises Exchange, the link can * be accessible on a private network as long as it doesn't need further authentication. * * `attachments.isInline`: Only used if type is set to file. If true, indicates that the attachment will be shown inline in the * message body, and should not be displayed in the attachment list. * * `attachments.itemId`: Only used if type is set to item. The EWS item ID of the existing e-mail you want to attach to the new message. * This is a string up to 100 characters. */ displayNewMessageForm(parameters: any): void; /** * Displays a form for creating a new message. * * The `displayNewMessageFormAsync` method opens a form that enables the user to create a new message. * If parameters are specified, the message form fields are automatically populated with the contents of the parameters. * * If any of the parameters exceed the specified size limits, or if an unknown parameter name is specified, an exception is thrown. * * @remarks * [Api set: Mailbox 1.9] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Read * * @param parameters - A dictionary containing all values to be filled in for the user in the new form. All parameters are optional. * * `toRecipients`: An array of strings containing the email addresses or an array containing an {@link Office.EmailAddressDetails | EmailAddressDetails} object * for each of the recipients on the **To** line. The array is limited to a maximum of 100 entries. * * `ccRecipients`: An array of strings containing the email addresses or an array containing an {@link Office.EmailAddressDetails | EmailAddressDetails} object * for each of the recipients on the **Cc** line. The array is limited to a maximum of 100 entries. * * `bccRecipients`: An array of strings containing the email addresses or an array containing an {@link Office.EmailAddressDetails | EmailAddressDetails} object * for each of the recipients on the **Bcc** line. The array is limited to a maximum of 100 entries. * * `subject`: A string containing the subject of the message. The string is limited to a maximum of 255 characters. * * `htmlBody`: The HTML body of the message. The body content is limited to a maximum size of 32 KB. * * `attachments`: An array of JSON objects that are either file or item attachments. * * `attachments.type`: Indicates the type of attachment. Must be file for a file attachment or item for an item attachment. * * `attachments.name`: A string that contains the name of the attachment, up to 255 characters in length. * * `attachments.url`: Only used if type is set to file. The URI of the location for the file. **Important**: This link must be * publicly accessible, without need for authentication by Exchange Online servers. However, with on-premises Exchange, the link can * be accessible on a private network as long as it doesn't need further authentication. * * `attachments.isInline`: Only used if type is set to file. If true, indicates that the attachment will be shown inline in the * message body, and should not be displayed in the attachment list. * * `attachments.itemId`: Only used if type is set to item. The EWS item ID of the existing e-mail you want to attach to the new message. * This is a string up to 100 characters. * @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 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. */ displayNewMessageFormAsync(parameters: any, options: Office.AsyncContextOptions, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Displays a form for creating a new message. * * The `displayNewMessageFormAsync` method opens a form that enables the user to create a new message. * If parameters are specified, the message form fields are automatically populated with the contents of the parameters. * * If any of the parameters exceed the specified size limits, or if an unknown parameter name is specified, an exception is thrown. * * @remarks * [Api set: Mailbox 1.9] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Read * * @param parameters - A dictionary containing all values to be filled in for the user in the new form. All parameters are optional. * * `toRecipients`: An array of strings containing the email addresses or an array containing an {@link Office.EmailAddressDetails | EmailAddressDetails} object * for each of the recipients on the **To** line. The array is limited to a maximum of 100 entries. * * `ccRecipients`: An array of strings containing the email addresses or an array containing an {@link Office.EmailAddressDetails | EmailAddressDetails} object * for each of the recipients on the **Cc** line. The array is limited to a maximum of 100 entries. * * `bccRecipients`: An array of strings containing the email addresses or an array containing an {@link Office.EmailAddressDetails | EmailAddressDetails} object * for each of the recipients on the **Bcc** line. The array is limited to a maximum of 100 entries. * * `subject`: A string containing the subject of the message. The string is limited to a maximum of 255 characters. * * `htmlBody`: The HTML body of the message. The body content is limited to a maximum size of 32 KB. * * `attachments`: An array of JSON objects that are either file or item attachments. * * `attachments.type`: Indicates the type of attachment. Must be file for a file attachment or item for an item attachment. * * `attachments.name`: A string that contains the name of the attachment, up to 255 characters in length. * * `attachments.url`: Only used if type is set to file. The URI of the location for the file. **Important**: This link must be * publicly accessible, without need for authentication by Exchange Online servers. However, with on-premises Exchange, the link can * be accessible on a private network as long as it doesn't need further authentication. * * `attachments.isInline`: Only used if type is set to file. If true, indicates that the attachment will be shown inline in the * message body, and should not be displayed in the attachment list. * * `attachments.itemId`: Only used if type is set to item. The EWS item ID of the existing e-mail you want to attach to the new message. * This is a string up to 100 characters. * @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. */ displayNewMessageFormAsync(parameters: any, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Gets a string that contains a token used to call REST APIs or Exchange Web Services (EWS). * * The `getCallbackTokenAsync` method makes an asynchronous call to get an opaque token from the Exchange Server that hosts the user's mailbox. * The lifetime of the callback token is 5 minutes. * * The token is returned as a string in the `asyncResult.value` property. * * @remarks * [Api set: Mailbox 1.5] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose or Read * * *REST Tokens* * * When a REST token is requested (`options.isRest` = `true`), the resulting token won't work to authenticate EWS calls. * The token will be limited in scope to read-only access to the current item and its attachments, unless the add-in has specified the * **read/write mailbox** permission in its manifest. * If the **read/write mailbox** permission is specified, the resulting token will grant read/write access to mail, calendar, and contacts, * including the ability to send mail. * * The add-in should use the `restUrl` property to determine the correct URL to use when making REST API calls. * * This API works for the following scopes. * * - `Mail.ReadWrite` * * - `Mail.Send` * * - `Calendars.ReadWrite` * * - `Contacts.ReadWrite` * * *EWS Tokens* * * When an EWS token is requested (`options.isRest` = `false`), the resulting token won't work to authenticate REST API calls. * The token will be limited in scope to accessing the current item. * * The add-in should use the `ewsUrl` property to determine the correct URL to use when making EWS calls. * * You can pass both the token and either an attachment identifier or item identifier to an external system. That system uses * the token as a bearer authorization token to call the Exchange Web Services (EWS) * {@link https://learn.microsoft.com/exchange/client-developer/web-service-reference/getattachment-operation | GetAttachment} operation or * {@link https://learn.microsoft.com/exchange/client-developer/web-service-reference/getitem-operation | GetItem} operation to return an * attachment or item. For example, you can create a remote service to * {@link https://learn.microsoft.com/office/dev/add-ins/outlook/get-attachments-of-an-outlook-item | get attachments from the selected item}. * * **Important**: * * - This method is only supported in read mode in Outlook on Android and on iOS. For more information on supported APIs in Outlook mobile, see * {@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-mobile-apis | Outlook JavaScript APIs supported in Outlook on mobile devices}. * * - EWS operations aren't supported in add-ins running in Outlook on iOS and on Android. A REST token is always returned in Outlook * mobile clients even if `options.isRest` is set to `false`. * *- Calling the `getCallbackTokenAsync` method in read mode requires a minimum permission level of **read item**. * * - Calling the `getCallbackTokenAsync` method in compose mode requires you to have saved the item. * The `saveAsync` method requires a minimum permission level of **read/write item**. * * - For guidance on delegate or shared scenarios, see the * {@link https://learn.microsoft.com/office/dev/add-ins/outlook/delegate-access | shared folders and shared mailbox} article. * * **Errors**: * * - `HTTPRequestFailure`: The request has failed. Please look at the diagnostics object for the HTTP error code. * * - `InternalServerError`: The Exchange server returned an error. Please look at the diagnostics object for more information. * * - `NetworkError`: The user is no longer connected to the network. Please check your network connection and try again. * * @param options - An object literal that contains one or more of the following properties:- * `isRest`: Determines if the token provided will be used for the Outlook REST APIs or Exchange Web Services. Default value is `false`. * `asyncContext`: Any state data that is passed to the asynchronous 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 token is returned as a string in the `asyncResult.value` property. * If there was an error, the `asyncResult.error` and `asyncResult.diagnostics` properties may provide additional information. */ getCallbackTokenAsync(options: Office.AsyncContextOptions & { isRest?: boolean }, callback: (asyncResult: Office.AsyncResult) => void): void; /** * Gets a string that contains a token used to get an attachment or item from an Exchange Server. * * The `getCallbackTokenAsync` method makes an asynchronous call to get an opaque token from the Exchange Server that hosts the user's mailbox. * The lifetime of the callback token is 5 minutes. * * The token is returned as a string in the `asyncResult.value` property. * * @remarks * [Api set: All support Read mode; Mailbox 1.3 introduced Compose mode support] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose or Read * * **Important**: * * - You can pass both the token and either an attachment identifier or item identifier to an external system. That system uses * the token as a bearer authorization token to call the Exchange Web Services (EWS) * {@link https://learn.microsoft.com/exchange/client-developer/web-service-reference/getattachment-operation | GetAttachment} or * {@link https://learn.microsoft.com/exchange/client-developer/web-service-reference/getitem-operation | GetItem} operation to return an * attachment or item. For example, you can create a remote service to * {@link https://learn.microsoft.com/office/dev/add-ins/outlook/get-attachments-of-an-outlook-item | get attachments from the selected item}. * * - Calling the `getCallbackTokenAsync` method in read mode requires a minimum permission level of **read item**. * * - Calling the `getCallbackTokenAsync` method in compose mode requires you to have saved the item. * The `saveAsync` method requires a minimum permission level of **read/write item**. * * - This method isn't supported in Outlook on Android or on iOS. EWS operations aren't supported in add-ins running on Outlook mobile clients. * For more information on supported APIs in Outlook mobile, see * {@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-mobile-apis | Outlook JavaScript APIs supported in Outlook on mobile devices}. * * - For guidance on delegate or shared scenarios, see the * {@link https://learn.microsoft.com/office/dev/add-ins/outlook/delegate-access | shared folders and shared mailbox} article. * * **Errors**: * * - `HTTPRequestFailure`: The request has failed. Please look at the diagnostics object for the HTTP error code. * * - `InternalServerError`: The Exchange server returned an error. Please look at the diagnostics object for more information. * * - `NetworkError`: The user is no longer connected to the network. Please check your network connection and try again. * * @param callback - When the method completes, the function passed in the callback parameter is called with a single parameter of * type `Office.AsyncResult`. The token is returned as a string in the `asyncResult.value` property. * If there was an error, the `asyncResult.error` and `asyncResult.diagnostics` properties may provide additional information. * @param userContext - Optional. Any state data that is passed to the asynchronous method. */ getCallbackTokenAsync(callback: (asyncResult: Office.AsyncResult) => void, userContext?: any): void; /** * Gets currently selected messages on which an add-in can activate and perform operations. An add-in can activate on a maximum of 100 messages at a time. * To learn more about item multi-select, see * {@link https://learn.microsoft.com/office/dev/add-ins/outlook/item-multi-select | Activate your Outlook add-in on multiple messages}. * * @remarks * [Api set: Mailbox 1.13] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read/write mailbox** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose, Read * * **Important**: This method only applies to messages. * * @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 function. * @param callback - When the method completes, the function passed in the `callback` parameter is called with a single parameter, * `asyncResult`, which is an `Office.AsyncResult` object. The properties of the selected messages, such as the item ID and subject, are returned as an array of * {@link Office.SelectedItemDetails | SelectedItemDetails} objects in the `asyncResult.value` property. The objects in the array follow the order in which * messages were selected. */ getSelectedItemsAsync(options: Office.AsyncContextOptions, callback: (asyncResult: Office.AsyncResult) => void): void; /** * Gets currently selected messages on which an add-in can activate and perform operations. An add-in can activate on a maximum of 100 messages at a time. * To learn more about item multi-select, see * {@link https://learn.microsoft.com/office/dev/add-ins/outlook/item-multi-select | Activate your Outlook add-in on multiple messages}. * * @remarks * [Api set: Mailbox 1.13] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read/write mailbox** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose, Read * * **Important**: This method only applies to messages. * * @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 function. * @param callback - When the method completes, the function passed in the `callback` parameter is called with a single parameter, * `asyncResult`, which is an `Office.AsyncResult` object. The properties of the selected messages, such as the item ID and subject, are returned as an array of * {@link Office.SelectedItemDetails | SelectedItemDetails} objects in the `asyncResult.value` property. The objects in the array follow the order in which * messages were selected. */ getSelectedItemsAsync(callback: (asyncResult: Office.AsyncResult) => void): void; /** * Gets a token identifying the user and the Office Add-in. * * The token is returned as a string in the `asyncResult.value` property. * * @remarks * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose or Read * * The `getUserIdentityTokenAsync` method returns a token that you can use to identify and * {@link https://learn.microsoft.com/office/dev/add-ins/outlook/authentication | authenticate the add-in and user with an external system}. * * **Errors**: * * - `HTTPRequestFailure`: The request has failed. Please look at the diagnostics object for the HTTP error code. * * - `InternalServerError`: The Exchange server returned an error. Please look at the diagnostics object for more information. * * - `NetworkError`: The user is no longer connected to the network. Please check your network connection and try again. * * @param callback - When the method completes, the function passed in the callback parameter is called with a single parameter of * type `Office.AsyncResult`. * The token is returned as a string in the `asyncResult.value` property. * If there was an error, the `asyncResult.error` and `asyncResult.diagnostics` properties may provide additional information. * @param userContext - Optional. Any state data that is passed to the asynchronous method. */ getUserIdentityTokenAsync(callback: (asyncResult: Office.AsyncResult) => void, userContext?: any): void; /** * Makes an asynchronous request to an Exchange Web Services (EWS) service on the Exchange server that hosts the user's mailbox. * * The `makeEwsRequestAsync` method sends an EWS request on behalf of the add-in to Exchange. * * @remarks * [Api set: Mailbox 1.1] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read/write mailbox** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose or Read * * **Important**: * * - To enable the `makeEwsRequestAsync` method to make EWS requests, the server administrator must set `OAuthAuthentication` to `true` on the * Client Access Server EWS directory . * * - Your add-in must have the **read/write mailbox** permission to use the `makeEwsRequestAsync` method. * For information about using the **read/write mailbox** permission and the EWS operations that you can call with the `makeEwsRequestAsync` method, see * {@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Specify permissions for mail add-in access to the user's mailbox}. * * - If your add-in needs to access Folder Associated Items or its XML request must specify UTF-8 encoding (`\`), * it must use Microsoft Graph or REST APIs to access the user's mailbox instead. * * - This method isn't supported in Outlook on Android or on iOS. For more information on supported APIs in Outlook mobile, see * {@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-mobile-apis | Outlook JavaScript APIs supported in Outlook on mobile devices}. * * - This method isn't supported when the add-in is loaded in a Gmail mailbox. * * - When you use the `makeEwsRequestAsync` method in add-ins that run in Outlook versions earlier than Version 15.0.4535.1004, you must set * the encoding value to ISO-8859-1 (``). To determine the version of an Outlook client, use the * `mailbox.diagnostics.hostVersion` property. You don't need to set the encoding value when your add-in is running in Outlook on the web. * To determine the Outlook client in which your add-in is running, use the `mailbox.diagnostics.hostName` property. * * @param data - The EWS request. * @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 XML of the EWS request provided as a string. * If the result exceeds 1 MB in size, an error message is returned in the `error` property. * @param userContext - Optional. Any state data that is passed to the asynchronous method. */ makeEwsRequestAsync(data: any, callback: (asyncResult: Office.AsyncResult) => void, userContext?: any): void; /** * Removes the event handlers for a supported event type. **Note**: Events are only available with task pane implementation. * * For supported events, refer to the Mailbox object model * {@link https://learn.microsoft.com/javascript/api/requirement-sets/outlook/preview-requirement-set/office.context.mailbox#events | events section}. * * @remarks * [Api set: Mailbox 1.5] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose or Read * * @param eventType - The event that should revoke the handler. * @param options - Provides an option for preserving context data of any type, unchanged, for use in a callback. * @param callback - Optional. When the method completes, the function passed in the `callback` parameter is called with a single parameter of * type `Office.AsyncResult`. */ 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 only available with task pane implementation. * * For supported events, refer to the Mailbox object model * {@link https://learn.microsoft.com/javascript/api/requirement-sets/outlook/preview-requirement-set/office.context.mailbox#events | events section}. * * @remarks * [Api set: Mailbox 1.5] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#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 of * type `Office.AsyncResult`. */ removeHandlerAsync(eventType: Office.EventType | string, callback?: (asyncResult: Office.AsyncResult) => void): void; } /** * The `MailboxEvent` object is passed as an argument to the event handler of an add-in that implements * {@link https://learn.microsoft.com/office/dev/add-ins/outlook/autolaunch | event-based activation}, including * {@link https://learn.microsoft.com/office/dev/add-ins/outlook/smart-alerts-onmessagesend-walkthrough | Smart Alerts}, * or the {@link https://learn.microsoft.com/office/dev/add-ins/outlook/spam-reporting | integrated spam-reporting feature}. * It allows the add-in to signify to the Outlook client that it has completed processing an event. * * @remarks * [Api set: Mailbox 1.10] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **restricted** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose or Read */ interface MailboxEvent { /** * Indicates that the event-based or spam-reporting add-in has completed processing an event. * * @remarks * [Api set: Mailbox 1.10] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **restricted** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose or Read * * @param options - Optional. An object that specifies the behavior of an event-based or spam-reporting add-in when it completes processing an event. */ completed(options?: SmartAlertsEventCompletedOptions | SpamReportingEventCompletedOptions): void; } /** * Represents the categories master list on the mailbox. * * In Outlook, a user can tag messages and appointments by using a category to color-code them. * The user defines categories in a master list on their mailbox. They can then apply one or more categories to an item. * * **Important**: In delegate or shared scenarios, the delegate can get the categories in the master list but can't add or remove categories. * * @remarks * [Api set: Mailbox 1.8] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read/write mailbox** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose or Read */ interface MasterCategories { /** * Adds categories to the master list on a mailbox. Each category must have a unique name but multiple categories can use the same color. * * @remarks * [Api set: Mailbox 1.8] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read/write mailbox** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose or Read * * **Errors**: * * - `DuplicateCategory`: One of the categories provided is already in the master category list. * * - `PermissionDenied`: The user does not have permission to perform this action. * * @param categories - The categories to be added to the master list on the mailbox. * @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 function. * @param callback - Optional. When the method completes, the function passed in the `callback` parameter is called with a single parameter of * type `Office.AsyncResult`. */ addAsync(categories: CategoryDetails[], options: Office.AsyncContextOptions, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Adds categories to the master list on a mailbox. Each category must have a unique name but multiple categories can use the same color. * * @remarks * [Api set: Mailbox 1.8] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read/write mailbox** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose or Read * * **Errors**: * * - `DuplicateCategory`: One of the categories provided is already in the master category list. * * - `PermissionDenied`: The user does not have permission to perform this action. * * @param categories - The categories to be added to the master list on the mailbox. * @param callback - Optional. When the method completes, the function passed in the `callback` parameter is called with a single parameter of * type `Office.AsyncResult`. */ addAsync(categories: CategoryDetails[], callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Gets the master list of categories on a mailbox. * * @remarks * [Api set: Mailbox 1.8] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read/write mailbox** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#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 function. * @param callback - When the method completes, the function passed in the `callback` parameter is called with a single parameter of * type `Office.AsyncResult`. If adding categories fails, the `asyncResult.error` property will contain an error code. */ getAsync(options: Office.AsyncContextOptions, callback: (asyncResult: Office.AsyncResult) => void): void; /** * Gets the master list of categories on a mailbox. * * @remarks * [Api set: Mailbox 1.8] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read/write mailbox** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#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`. */ getAsync(callback: (asyncResult: Office.AsyncResult) => void): void; /** * Removes categories from the master list on a mailbox. * * @remarks * [Api set: Mailbox 1.8] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read/write mailbox** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose or Read * * **Errors**: * * - `PermissionDenied`: The user does not have permission to perform this action. * * @param categories - The categories to be removed from the master list on the mailbox. * @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 function. * @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 categories fails, the `asyncResult.error` property will contain an error code. */ removeAsync(categories: string[], options: Office.AsyncContextOptions, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Removes categories from the master list on a mailbox. * * @remarks * [Api set: Mailbox 1.8] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read/write mailbox** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose or Read * * **Errors**: * * - `PermissionDenied`: The user does not have permission to perform this action. * * @param categories - The categories to be removed from the master list on the mailbox. * @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 categories fails, the `asyncResult.error` property will contain an error code. */ removeAsync(categories: string[], callback?: (asyncResult: Office.AsyncResult) => void): void; } /** * Represents a suggested meeting found in an item. Read mode only. * * The list of meetings suggested in an email message is returned in the `meetingSuggestions` property of the `Entities` object that is returned when * the `getEntities` or `getEntitiesByType` method is called on the active item. * * The start and end values are string representations of a `Date` object that contains the date and time at which the suggested meeting is to * begin and end. The values are in the default time zone specified for the current user. * * @remarks * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Read */ interface MeetingSuggestion { /** * Gets the attendees for a suggested meeting. */ attendees: EmailUser[]; /** * Gets the date and time that a suggested meeting is to end. */ end: string; /** * Gets the location of a suggested meeting. */ location: string; /** * Gets a string that was identified as a meeting suggestion. */ meetingString: string; /** * Gets the date and time that a suggested meeting is to begin. */ start: string; /** * Gets the subject of a suggested meeting. */ subject: string; } /** * A subclass of {@link Office.Item | Item} for messages. * * **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`. For more information, refer to the * {@link https://learn.microsoft.com/javascript/api/requirement-sets/outlook/preview-requirement-set/office.context.mailbox.item | Object Model} page. * * Child interfaces: * * - {@link Office.MessageCompose | MessageCompose} * * - {@link Office.MessageRead | MessageRead} */ interface Message extends Item { } /** * The message compose mode of {@link Office.Item | Office.context.mailbox.item}. * * **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`. For more information, refer to the * {@link https://learn.microsoft.com/javascript/api/requirement-sets/outlook/preview-requirement-set/office.context.mailbox.item | Object Model} page. * * Parent interfaces: * * - {@link Office.ItemCompose | ItemCompose} * * - {@link Office.Message | Message} */ interface MessageCompose extends Message, ItemCompose { /** * Gets an object that provides methods to get or update the recipients on the **Bcc** (blind carbon copy) line of a message. * * Depending on the client/platform (i.e., Windows, Mac, etc.), limits may apply on how many recipients you can get or update. * See the {@link Office.Recipients | Recipients} object for more details. * * @remarks * [Api set: Mailbox 1.1] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Message Compose */ bcc: Recipients; /** * Gets an object that provides methods for manipulating the body of an item. * * @remarks * [Api set: Mailbox 1.1] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Message Compose */ body: Body; /** * Gets an object that provides methods for managing the item's categories. * * **Important**: In Outlook on the web, you can't use the API to manage categories on a message in Compose mode. * * @remarks * [Api set: Mailbox 1.8] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Message Compose */ categories: Categories; /** * Provides access to the Cc (carbon copy) recipients of a message. The type of object and level of access depend on the mode of the * current item. * * The `cc` property returns a `Recipients` object that provides methods to get or update the recipients on the * **Cc** line of the message. However, depending on the client/platform (i.e., Windows, Mac, etc.), limits may apply on how many recipients * you can get or update. See the {@link Office.Recipients | Recipients} object for more details. * * @remarks * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Message Compose */ cc: Recipients; /** * 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://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Message Compose */ conversationId: string; /** * Gets or sets the delayed delivery date and time of a message. * * The `delayDeliveryTime` property returns a `DelayDeliveryTime` object that provides methods to manage the delivery date and time of the message. * * @remarks * [Api set: Mailbox 1.13] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Message Compose */ delayDeliveryTime: DelayDeliveryTime; /** * Gets the email address of the sender of a message. * * The `from` property returns a `From` object that provides a method to get the from value. * * @remarks * [Api set: Mailbox 1.7] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Message Compose * * **Important**: This property is supported in Outlook on Android and on iOS. For a sample scenario, see * {@link https://learn.microsoft.com/office/dev/add-ins/outlook/mobile-event-based | Implement event-based activation in Outlook mobile add-ins}. */ from: From; /** * Gets or sets the custom internet headers of a message. * * The `internetHeaders` property returns an `InternetHeaders` object that provides methods to manage the internet headers on the message. * * To learn more, see * {@link https://learn.microsoft.com/office/dev/add-ins/outlook/internet-headers | Get and set internet headers on a message in an Outlook add-in}. * * @remarks * [Api set: Mailbox 1.8] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Message Compose */ internetHeaders: InternetHeaders; /** * 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://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Message Compose */ itemType: MailboxEnums.ItemType | string; /** * Gets the notification messages for an item. * * @remarks * [Api set: Mailbox 1.3] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Message Compose */ notificationMessages: NotificationMessages; /** * Gets the object to get or set the {@link Office.SensitivityLabel | sensitivity label} of a message. * * @remarks * [Api set: Mailbox 1.13] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read/write item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Message Compose * * **Important**: To use the sensitivity label feature in your add-in, you must have a Microsoft 365 E5 subscription. * * To learn more about how to manage sensitivity labels in your add-in, see * {@link https://learn.microsoft.com/office/dev/add-ins/outlook/sensitivity-label | Manage the sensitivity label of your message or appointment in compose mode}. */ sensitivityLabel: SensitivityLabel; /** * 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://learn.microsoft.com/office/dev/add-ins/outlook/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. * * @remarks * [Api set: Mailbox 1.7] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Message Compose */ seriesId: string; /** * Manages the {@link Office.SessionData | SessionData} of an item in Compose mode. * * **Important**: The entire SessionData object is limited to 50,000 characters per add-in. * * @remarks * [Api set: Mailbox 1.11] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Message Compose */ sessionData: SessionData; /** * 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://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Message Compose */ subject: Subject; /** * Provides access to the recipients on the **To** line of a message. The type of object and level of access depend on the mode of the * current item. * * The `to` property returns a `Recipients` object that provides methods to get or update the recipients on the * **To** line of the message. However, depending on the client/platform (i.e., Windows, Mac, etc.), limits may apply on how many recipients * you can get or update. See the {@link Office.Recipients | Recipients} object for more details. * * @remarks * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Message Compose */ to: Recipients; /** * 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. * * **Important**: In recent builds of Outlook on Windows, a bug was introduced that incorrectly appends an `Authorization: Bearer` header to * this action (whether using this API or the Outlook UI). To work around this issue, you can try using the `addFileAttachmentFromBase64` API * introduced with requirement set 1.8. * * @remarks * [Api set: Mailbox 1.1] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read/write item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Message 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 - 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 function. * `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. * * **Important**: In recent builds of Outlook on Windows, a bug was introduced that incorrectly appends an `Authorization: Bearer` header to * this action (whether using this API or the Outlook UI). To work around this issue, you can try using the `addFileAttachmentFromBase64` API * introduced with requirement set 1.8. * * @remarks * [Api set: Mailbox 1.1] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read/write item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Message 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. * * @remarks * [Api set: Mailbox 1.8] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read/write item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Message Compose * * **Important**: * * - Adding an inline Base64 file to a messsage in compose mode is supported in Outlook on Android and on iOS. For more information on supported APIs in * Outlook mobile, see {@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-mobile-apis | Outlook JavaScript APIs supported in Outlook on mobile devices}. * * - If you're using a data URL API (for example, `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,`. * * - If you're adding an inline Base64 image to the body of a message or appointment being composed, you must first get the current item body using the * {@link https://learn.microsoft.com/javascript/api/outlook/office.body#outlook-office-body-getasync-member(1) | Office.context.mailbox.item.body.getAsync} * method before inserting the image using `addFileAttachmentFromBase64Async`. Otherwise, the image won't render in the body once it's inserted. * For further guidance, see {@link https://learn.microsoft.com/office/dev/add-ins/outlook/add-and-remove-attachments-to-an-item-in-a-compose-form#attach-a-file | Attach a file}. * * **Errors**: * * - `AttachmentSizeExceeded`: The attachment is larger than allowed. * * - `FileTypeNotSupported`: The attachment has an extension that isn't 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. The maximum length of the encoded string is 27,892,122 characters (about 25 MB). * @param attachmentName - The name of the attachment that is shown while the attachment is uploading. The maximum length is 255 characters. * @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 function. * `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. * * @remarks * [Api set: Mailbox 1.8] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read/write item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Message Compose * * **Important**: * * - Adding an inline Base64 file to a messsage in compose mode is supported in Outlook on Android and on iOS. For more information on supported APIs in * Outlook mobile, see {@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-mobile-apis | Outlook JavaScript APIs supported in Outlook on mobile devices}. * * - If you're using a data URL API (for example, `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,`. * * - If you're adding an inline Base64 image to the body of a message or appointment being composed, you must first get the current item body using the * {@link https://learn.microsoft.com/javascript/api/outlook/office.body#outlook-office-body-getasync-member(1) | Office.context.mailbox.item.body.getAsync} * method before inserting the image using `addFileAttachmentFromBase64Async`. Otherwise, the image won't render in the body once it's inserted. * For further guidance, see {@link https://learn.microsoft.com/office/dev/add-ins/outlook/add-and-remove-attachments-to-an-item-in-a-compose-form#attach-a-file | Attach a file}. * * **Errors**: * * - `AttachmentSizeExceeded`: The attachment is larger than allowed. * * - `FileTypeNotSupported`: The attachment has an extension that isn't 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. The maximum length of the encoded string is 27,892,122 characters (about 25 MB). * @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 event handler for a supported event. **Note**: Events are only available with task pane implementation. * * For supported events, refer to the Item object model * {@link https://learn.microsoft.com/javascript/api/requirement-sets/outlook/preview-requirement-set/office.context.mailbox.item#events | events section}. * * @remarks * [Api set: Mailbox 1.7] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Message Compose * * @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 - 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 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. */ 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 only available with task pane implementation. * * For supported events, refer to the Item object model * {@link https://learn.microsoft.com/javascript/api/requirement-sets/outlook/preview-requirement-set/office.context.mailbox.item#events | events section}. * * @remarks * [Api set: Mailbox 1.7] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Message Compose * * @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; /** * 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 function, 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 function, 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. * * @remarks * [Api set: Mailbox 1.1] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read/write item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Message 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 - 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 function. * @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 function, 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 function, 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. * * @remarks * [Api set: Mailbox 1.1] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read/write item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Message 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 behavior 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, the `close` method has no effect on a reply in the Reading Pane. * * @remarks * [Api set: Mailbox 1.3] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **restricted** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Message Compose * * **Important**: 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. * * **Tip**: Use the * {@link https://learn.microsoft.com/javascript/api/outlook/office.messagecompose?view=outlook-js-preview&preserve-view=true#outlook-office-messagecompose-closeasync-member(1) | closeAsync} * method instead of the `close` method if you want your add-in to: * * - Automatically discard a message being composed without prompting the user with the save dialog. * * - Determine when a user cancels the save item dialog on a message being composed. * * - Close a reply in the Reading Pane or an existing draft from an Outlook desktop client. * */ close(): void; /** * Closes the current message being composed with the option to discard unsaved changes. * The message being composed can be a new message, reply, or an existing draft. * * @remarks * [Api set: Mailbox preview] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read/write item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Message Compose * * **Important**: The `closeAsync` method is in preview. It's only supported in Outlook on Windows at this time. * * **Errors**: * * - `The operation was cancelled by the user`: The user selects **Cancel** from the save dialog and the `discardItem` property isn't defined or is set to `false`. * * - `The operation is not supported`: The `closeAsync` method attempts to close a reply in the Reading Pane or an existing draft and the `discardItem` property isn't defined or * is set to `false`. * * @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 function. * `discardItem`: If `true`, the current message being composed is closed and unsaved changes are discarded. When the parameter isn't declared or is * set to `false`, a save dialog appears prompting the user to save a draft, discard changes, or cancel the operation. This behavior occurs for new messages and replies * popped out from the Reading Pane. If you want to close a reply in the Reading Pane or an existing draft, you must set `discardItem` to `true`. Otherwise, the call will * return an error. For more information on the error, see the Remarks section. * * @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. * * @beta */ closeAsync(options: Office.AsyncContextOptions & { discardItem: boolean }, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Closes the current new message being composed. * * The behavior on a new message being composed depends on whether the message contains any unsaved changes. If no changes have been made, the message is * closed without a save dialog. On the other hand, if the message contains unsaved changes, a save dialog appears prompting the user to save a draft, * discard changes, or cancel the operation. * * @remarks * [Api set: Mailbox preview] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read/write item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Message Compose * * **Important**: The `closeAsync` method is in preview. It's only supported in Outlook on Windows at this time. * * **Errors**: * * - `The operation was cancelled by the user`: The user selects **Cancel** from the save dialog. * * - `The operation is not supported`: The `closeAsync` method attempts to close a reply in the Reading Pane or an existing draft. * * @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. * * @beta */ closeAsync(callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Disables the Outlook client signature. * * The behavior of this method depends on which client the add-in is running. * * - In Outlook on Windows and on Mac, the signature under the **New messages** and **Replies/forwards** sections * of the sending account is set to **(none)**. * * - In Outlook on the web, the signature option for new mails, replies, and forwards is disabled. * A signature that's selected is also disabled by the method. * * - In Outlook on Android and on iOS, the signature saved on the mobile device is cleared. * * @remarks * [Api set: Mailbox 1.10] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read/write item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Message Compose * * **Important**: This method is supported in Message Compose on Outlook on Android and on iOS. For more information on supported APIs in * Outlook mobile, see {@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-mobile-apis | Outlook JavaScript APIs supported in Outlook on mobile devices}. * * @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 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. */ disableClientSignatureAsync(options: Office.AsyncContextOptions, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Disables the Outlook client signature. * * The behavior of this method depends on which client the add-in is running. * * - In Outlook on Windows and on Mac, the signature under the **New messages** and **Replies/forwards** sections * of the sending account is set to **(none)**. * * - In Outlook on the web, the signature option for new mails, replies, and forwards is disabled. * A signature that's selected is also disabled by the method. * * - In Outlook on Android and on iOS, the signature saved on the mobile device is cleared. * * @remarks * [Api set: Mailbox 1.10] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read/write item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Message Compose * * **Important**: This method is supported in Message Compose in Outlook on Android and on iOS. For more information on supported APIs in * Outlook mobile, see {@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-mobile-apis | Outlook JavaScript APIs supported in Outlook on mobile devices}. * * @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. */ disableClientSignatureAsync(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 get * the attachment's identifier from a `getAttachmentsAsync` call, then in the same session, use that identifier to retrieve the attachment. * 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. * * @remarks * [Api set: Mailbox 1.8] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Message Compose * * **Errors**: * * - `AttachmentTypeNotSupported`: The attachment type isn't supported. Unsupported types include embedded images in Rich Text Format, * or item attachment types other than email or calendar items (such as a contact or task item). * * - `InvalidAttachmentId`: The attachment identifier does not exist. * * @param attachmentId - The identifier of the attachment you want to get. * @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 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. If the call fails, the `asyncResult.error` property will contain * an 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 get * the attachment's identifier from a `getAttachmentsAsync` call, then in the same session, use that identifier to retrieve the attachment. * 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. * * @remarks * [Api set: Mailbox 1.8] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Message Compose * * **Errors**: * * - `AttachmentTypeNotSupported`: The attachment type isn't supported. Unsupported types include embedded images in Rich Text Format, * or item attachment types other than email or calendar items (such as a contact or task item). * * - `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 * an 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. * * @remarks * [Api set: Mailbox 1.8] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#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 function. * @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 an 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. * * @remarks * [Api set: Mailbox 1.8] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Message 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 an error code with the reason for * the failure. */ getAttachmentsAsync(callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Specifies the type of message compose and its coercion type. The message can be new, or a reply or forward. * The coercion type can be HTML or plain text. * * @remarks * [Api set: Mailbox 1.10] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Message Compose * * **Important**: This method is supported in Outlook on Android and on iOS. For more information on supported APIs in * Outlook mobile, see {@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-mobile-apis | Outlook JavaScript APIs supported in Outlook on mobile devices}. * * @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 function. * @param callback - When the method completes, the function passed in the `callback` parameter is called with a single parameter of * type `Office.AsyncResult`. On success, the `asyncResult.value` property contains an object with the item's compose type * and coercion type. * * @returns * An object with `ComposeType` and `CoercionType` enum values for the message item. */ getComposeTypeAsync(options: Office.AsyncContextOptions, callback: (asyncResult: Office.AsyncResult) => void): void; /** * Specifies the type of message compose and its coercion type. The message can be new, or a reply or forward. * The coercion type can be HTML or plain text. * * @remarks * [Api set: Mailbox 1.10] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Message Compose * * **Important**: This method is supported in Outlook on Android and on iOS. For more information on supported APIs in * Outlook mobile, see {@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-mobile-apis | Outlook JavaScript APIs supported in Outlook on mobile devices}. * * @param callback - When the method completes, the function passed in the `callback` parameter is called with a single parameter of * type `Office.AsyncResult`. On success, the `asyncResult.value` property contains an object with the item's compose type * and coercion type. * * @returns * An object with `ComposeType` and `CoercionType` enum values for the message item. */ getComposeTypeAsync(callback: (asyncResult: Office.AsyncResult) => void): void; /** * Gets initialization data passed when the add-in is {@link https://learn.microsoft.com/outlook/actionable-messages/invoke-add-in | activated by an actionable message}. * * @remarks * [Api set: Mailbox 1.8] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#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 function. * @param callback - 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 context data is provided as a string (or an empty string if there's no initialization context) * in the `asyncResult.value` property.. */ getInitializationContextAsync(options: Office.AsyncContextOptions, callback: (asyncResult: Office.AsyncResult) => void): void; /** * Gets initialization data passed when the add-in is {@link https://learn.microsoft.com/outlook/actionable-messages/invoke-add-in | activated by an actionable message}. * * @remarks * [Api set: Mailbox 1.8] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#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`. * On success, the initialization context data is provided as a string (or an empty string if there's no initialization context) * in the `asyncResult.value` property. */ getInitializationContextAsync(callback: (asyncResult: Office.AsyncResult) => void): void; /** * Asynchronously gets the ID of a saved item. * * When invoked, this method returns the item ID via the callback function. * * **Note**: If your add-in calls `getItemIdAsync` on an item in compose mode (e.g., 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 synced to the server. * Until the item is synced, the `itemId` is not recognized and using it returns an error. * * @remarks * [Api set: Mailbox 1.8] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Message Compose * * **Errors**: * * - `ItemNotSaved`: The ID can't be retrieved until the item is saved. * * @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 function. * @param callback - When the method completes, the function passed in the `callback` parameter is called with a single parameter * of type `Office.AsyncResult`. */ getItemIdAsync(options: Office.AsyncContextOptions, callback: (asyncResult: Office.AsyncResult) => void): void; /** * Asynchronously gets the ID of a saved item. * * When invoked, this method returns the item ID via the callback function. * * **Note**: If your add-in calls `getItemIdAsync` on an item in compose mode (e.g., 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 synced to the server. * Until the item is synced, the `itemId` is not recognized and using it returns an error. * * @remarks * [Api set: Mailbox 1.8] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Message Compose * * **Errors**: * * - `ItemNotSaved`: The ID can't be retrieved until the item is saved. * * @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; /** * 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 function, 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`. * * @returns * The selected data as a string with format determined by `coercionType`. * * @remarks * [Api set: Mailbox 1.2] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Message 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 function. * @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 function, 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`. * * @returns * The selected data as a string with format determined by `coercionType`. * * @remarks * [Api set: Mailbox 1.2] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Message 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; /** * Gets the properties of an appointment or message in a shared folder or shared mailbox. * * For more information around using this API, see * {@link https://learn.microsoft.com/office/dev/add-ins/outlook/delegate-access | Enable shared folders and shared mailbox scenarios in an Outlook add-in}. * * @remarks * [Api set: Mailbox 1.8 for shared folder support, Mailbox 1.13 for shared mailbox support] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Message Compose * * **Note**: This method is not supported in Outlook on iOS or Android. * * **Important**: In Message Compose mode, this API is not supported in Outlook on the web or on Windows unless the following conditions are met. * * a. **Delegate access/Shared folders** * * 1. The mailbox owner starts a message. This can be a new message, a reply, or a forward. * * 2. They save the message then move it from their own **Drafts** folder to a folder shared with the delegate. * * 3. The delegate opens the draft from the shared folder then continues composing. * * b. **Shared mailbox (applies to Outlook on Windows only)** * * 1. The shared mailbox user starts a message. This can be a new message, a reply, or a forward. * * 2. They save the message then move it from their own **Drafts** folder to a folder in the shared mailbox. * * 3. Another shared mailbox user opens the draft from the shared mailbox then continues composing. * * The message is now in a shared context and add-ins that support these shared scenarios can get the item's shared properties. * After the message has been sent, it's usually found in the sender's **Sent Items** folder. * * @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 function. * @param callback - When the method completes, the function passed in the `callback` parameter is called with a single parameter, `asyncResult`, which is an * `Office.AsyncResult` object. The `asyncResult.value` property provides 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 or shared mailbox. * * For more information around using this API, see * {@link https://learn.microsoft.com/office/dev/add-ins/outlook/delegate-access | Enable shared folders and shared mailbox scenarios in an Outlook add-in}. * * @remarks * [Api set: Mailbox 1.8 for shared folder support, Mailbox 1.13 for shared mailbox support] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Message Compose * * **Note**: This method is not supported in Outlook on iOS or Android. * * **Important**: In Message Compose mode, this API is not supported in Outlook on the web or on Windows unless the following conditions are met. * * a. **Delegate access/Shared folders** * * 1. The mailbox owner starts a message. This can be a new message, a reply, or a forward. * * 2. They save the message then move it from their own **Drafts** folder to a folder shared with the delegate. * * 3. The delegate opens the draft from the shared folder then continues composing. * * b. **Shared mailbox (applies to Outlook on Windows only)** * * 1. The shared mailbox user starts a message. This can be a new message, a reply, or a forward. * * 2. They save the message then move it from their own **Drafts** folder to a folder in the shared mailbox. * * 3. Another shared mailbox user opens the draft from the shared mailbox then continues composing. * * The message is now in a shared context and add-ins that support these shared scenarios can get the item's shared properties. * After the message has been sent, it's usually found in the sender's **Sent Items** folder. * * @param callback - When the method completes, the function passed in the `callback` parameter is called with a single parameter, `asyncResult`, which is an * `Office.AsyncResult` object. The `asyncResult.value` property provides the properties of the shared item. */ getSharedPropertiesAsync(callback: (asyncResult: Office.AsyncResult) => void): void; /** * Gets if the client signature is enabled. * * For Windows and Mac rich clients, the API call should return `true` if the default signature for new messages, replies, or forwards is set * to a template for the sending Outlook account. * For Outlook on the web, the API call should return `true` if the signature is enabled for compose types `newMail`, `reply`, or `forward`. * If the settings are set to "(none)" in Mac or Windows rich clients or disabled in Outlook on the Web, the API call should return `false`. * * @remarks * [Api set: Mailbox 1.10] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#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 function. * @param callback - When the method completes, the function passed in the `callback` parameter is called with a single parameter of * type `Office.AsyncResult`. */ isClientSignatureEnabledAsync(options: Office.AsyncContextOptions, callback: (asyncResult: Office.AsyncResult) => void): void; /** * Gets if the client signature is enabled. * * For Windows and Mac rich clients, the API call should return `true` if the default signature for new messages, replies, or forwards is set * to a template for the sending Outlook account. * For Outlook on the web, the API call should return `true` if the signature is enabled for compose types `newMail`, `reply`, or `forward`. * If the settings are set to "(none)" in Mac or Windows rich clients or disabled in Outlook on the Web, the API call should return `false`. * * @remarks * [Api set: Mailbox 1.10] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#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`. */ isClientSignatureEnabledAsync(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 {@link Office.CustomProperties | 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 aren't encrypted on the item, so this shouldn't 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, save, and remove custom properties from the mail item. * * @remarks * [Api set: Mailbox 1.1] * * To learn more about custom properties, see * {@link https://learn.microsoft.com/office/dev/add-ins/outlook/metadata-for-an-outlook-add-in | Get and set add-in metadata for an Outlook add-in}. * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#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`. * @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 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. * * @remarks * [Api set: Mailbox 1.1] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read/write item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Message Compose * * **Errors**: * * - `InvalidAttachmentId`: The attachment identifier does not exist. * * @param attachmentId - The identifier of the attachment to remove. The maximum string length of the `attachmentId` * is 200 characters in Outlook on the web and on Windows. * @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 function. * @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. * * @remarks * [Api set: Mailbox 1.1] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read/write item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Message Compose * * **Errors**: * * - `InvalidAttachmentId`: The attachment identifier does not exist. * * @param attachmentId - The identifier of the attachment to remove. The maximum string length of the `attachmentId` * is 200 characters in Outlook on the web and on Windows. * @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; /** * Removes the event handlers for a supported event type. **Note**: Events are only available with task pane implementation. * * For supported events, refer to the Item object model * {@link https://learn.microsoft.com/javascript/api/requirement-sets/outlook/preview-requirement-set/office.context.mailbox.item#events | events section}. * * @remarks * [Api set: Mailbox 1.7] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Message Compose * * @param eventType - The event that should revoke the handler. * @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 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. */ 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 only available with task pane implementation. * * For supported events, refer to the Item object model * {@link https://learn.microsoft.com/javascript/api/requirement-sets/outlook/preview-requirement-set/office.context.mailbox.item#events | events section}. * * @remarks * [Api set: Mailbox 1.7] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Message Compose * * @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; /** * Asynchronously saves the current message as a draft. * * @remarks * [Api set: Mailbox 1.3] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read/write item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Message Compose * * **Important**: * * - 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. * * - When working with HTML-formatted content, it's important to note that the Outlook client may modify the content. This means that * subsequent calls to methods like `Body.getAsync`, `Body.setAsync`, and even `saveAsync` may not result in the same content. * * - If your add-in calls `saveAsync` on an item in compose mode in order to get an item ID 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 item ID will return an error. * * - In Outlook on the web, the mailbox account to which a draft is saved varies when `saveAsync` is called on a message that will be sent * from a shared mailbox account. If the sender creates a new message from their personal mailbox and selects the shared mailbox account * in the **From** field, `saveAsync` saves the draft to the **Drafts** folder of the user's personal mailbox. If the sender opens the * shared mailbox account in a separate browser tab (through the **Open another mailbox** option, for example) and creates a new message * there, `saveAsync` saves the draft to the **Drafts** folder of the shared mailbox. * * **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 function. * @param callback - When the method completes, the function passed in the `callback` parameter is called with a single parameter, `asyncResult`, * which is an `Office.AsyncResult` object. The message ID is returned in the `asyncResult.value` property. */ saveAsync(options: Office.AsyncContextOptions, callback: (asyncResult: Office.AsyncResult) => void): void; /** * Asynchronously saves the current message as a draft. * * @remarks * [Api set: Mailbox 1.3] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read/write item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Message Compose * * **Important**: * * - 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. * * - When working with HTML-formatted content, it's important to note that the Outlook client may modify the content. This means that * subsequent calls to methods like `Body.getAsync`, `Body.setAsync`, and even `saveAsync` may not result in the same content. * * - If your add-in calls `saveAsync` on an item in compose mode in order to get an item ID 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 item ID will return an error. * * - In Outlook on the web, the mailbox account to which a draft is saved varies when `saveAsync` is called on a message that will be sent * from a shared mailbox account. If the sender creates a new message from their personal mailbox and selects the shared mailbox account * in the **From** field, `saveAsync` saves the draft to the **Drafts** folder of the user's personal mailbox. If the sender opens the * shared mailbox account in a separate browser tab (through the **Open another mailbox** option, for example) and creates a new message * there, `saveAsync` saves the draft to the **Drafts** folder of the shared mailbox. * * **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, `asyncResult`, * which is an `Office.AsyncResult` object. The message ID is returned in the `asyncResult.value` property. */ 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. * * @remarks * [Api set: Mailbox 1.2] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read/write item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Message 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 - 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 function. * `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. * * @remarks * [Api set: Mailbox 1.2] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read/write item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Message 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 message read mode of {@link Office.Item | Office.context.mailbox.item}. * * **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`. For more information, refer to the * {@link https://learn.microsoft.com/javascript/api/requirement-sets/outlook/preview-requirement-set/office.context.mailbox.item | Object Model} page. * * Parent interfaces: * * - {@link Office.ItemRead | ItemRead} * * - {@link Office.Message | Message} */ interface MessageRead extends Message, ItemRead { /** * Gets the item's attachments as an array. * * @remarks * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Message 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.microsoft.com/office/434752e1-02d3-4e90-9124-8b81e49a8519 | Blocked attachments in Outlook}. * */ attachments: AttachmentDetails[]; /** * Gets an object that provides methods for manipulating the body of an item. * * @remarks * [Api set: Mailbox 1.1] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Message Read */ body: Body; /** * Gets an object that provides methods for managing the item's categories. * * @remarks * [Api set: Mailbox 1.8] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Message Read */ categories: Categories; /** * Provides access to the Cc (carbon copy) recipients of a message. The type of object and level of access depend on the mode of the * current item. * * The `cc` property returns an array that contains an {@link Office.EmailAddressDetails | EmailAddressDetails} object for * each recipient listed on the **Cc** line of the message. The maximum number of recipients returned varies per Outlook client. * * - Windows: 500 recipients * * - Android, classic Mac UI, iOS: 100 recipients * * - Web browser: 20 recipients * * - New Mac UI: No limit * * @remarks * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Message Read */ cc: EmailAddressDetails[]; /** * 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://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Message Read */ conversationId: string; /** * Gets the date and time that an item was created. * * @remarks * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Message Read */ dateTimeCreated: Date; /** * Gets the date and time that an item was last modified. * * @remarks * [Api set: Mailbox 1.1] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Appointment Attendee * * **Important**: This property isn't supported in Outlook on Android or on iOS. For more information on supported APIs in Outlook mobile, see * {@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-mobile-apis | Outlook JavaScript APIs supported in Outlook on mobile devices}. */ dateTimeModified: Date; /** * Gets an object to temporarily set the content displayed in the body or subject of a message in read mode. * * @remarks * [Api set: Mailbox preview] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read/write item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Message Read * * @beta */ display: Display; /** * Gets the date and time that the appointment is to end. * * The `end` property is a `Date` object expressed as a Coordinated Universal Time (UTC) date and time value. * You can use the `convertToLocalClientTime` method to convert the `end` property value to the client's local date and time. * * When you use the `Time.setAsync` method to set the end time, you should use the `convertToUtcClientTime` method to convert the local time on * the client to UTC for the server. * * @remarks * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Message Read */ end: Date; /** * Gets the email address of the sender of a message. * * The `from` and `sender` properties represent the same person unless the message is sent by a delegate. * In that case, the `from` property represents the delegator, and the `sender` property represents the delegate. * * **Note**: The `recipientType` property of the `EmailAddressDetails` object in the `from` property is undefined. * * The `from` property returns an `EmailAddressDetails` object. * * @remarks * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Message Read */ from: EmailAddressDetails; /** * Gets the internet message identifier for an email message. * * **Important**: In the **Sent Items** folder, the `internetMessageId` may not be available yet on recently sent items. In that case, * consider using {@link https://learn.microsoft.com/office/dev/add-ins/outlook/web-services | Exchange Web Services} to get this * {@link https://learn.microsoft.com/exchange/client-developer/web-service-reference/internetmessageid | property from the server}. * * @remarks * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Message Read */ internetMessageId: string; /** * 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://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Message 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://learn.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://learn.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://learn.microsoft.com/office/dev/add-ins/outlook/use-rest-api#get-the-item-id | Use the Outlook REST APIs from an Outlook add-in}. * * @remarks * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Message Read */ itemId: string; /** * 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://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Message Read */ itemType: MailboxEnums.ItemType | string; /** * Gets the location of a meeting request. * * The `location` property returns a string that contains the location of the appointment. * * @remarks * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Message Read */ location: 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://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Message Read */ normalizedSubject: string; /** * Gets the notification messages for an item. * * @remarks * [Api set: Mailbox 1.3] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Message Read */ notificationMessages: NotificationMessages; /** * Gets the recurrence pattern of an appointment. Gets the recurrence pattern of a meeting request. * Read and compose modes for appointment items. Read mode for meeting request items. * * The `recurrence` property returns a `Recurrence` object for recurring appointments or meetings requests if an item is a series or an instance * in a series. `null` is returned for single appointments and meeting requests of single appointments. * `undefined` is returned for messages that are not meeting requests. * * **Note**: Meeting requests have an itemClass value of `IPM.Schedule.Meeting.Request`. * * **Note**: If the `recurrence` object is null, this indicates that the object is a single appointment or a meeting request of a single appointment * and NOT a part of a series. * * @remarks * [Api set: Mailbox 1.7] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Message Read */ recurrence: Recurrence; /** * 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://learn.microsoft.com/office/dev/add-ins/outlook/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. * * @remarks * [Api set: Mailbox 1.7] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Message Read */ seriesId: string; /** * Gets the email address of the sender of an email message. * * The `from` and `sender` properties represent the same person unless the message is sent by a delegate. * In that case, the `from` property represents the delegator, and the `sender` property represents the delegate. * * **Note**: The `recipientType` property of the `EmailAddressDetails` object in the `sender` property is undefined. * * @remarks * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Message Read */ sender: EmailAddressDetails; /** * Gets the date and time that the appointment is to begin. * * The `start` property is a `Date` object expressed as a Coordinated Universal Time (UTC) date and time value. * You can use the `convertToLocalClientTime` method to convert the value to the client's local date and time. * * @remarks * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Message Read */ start: Date; /** * 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://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Message Read */ subject: string; /** * Provides access to the recipients on the **To** line of a message. The type of object and level of access depend on the mode of the * current item. * * The `to` property returns an array that contains an {@link Office.EmailAddressDetails | EmailAddressDetails} object for * each recipient listed on the **To** line of the message. The maximum number of recipients returned varies per Outlook client. * * - Windows: 500 recipients * * - Android, classic Mac UI, iOS: 100 recipients * * - Web browser: 20 recipients * * - New Mac UI: No limit * * @remarks * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Message Read */ to: EmailAddressDetails[]; /** * Adds an event handler for a supported event. **Note**: Events are only available with task pane implementation. * * For supported events, refer to the Item object model * {@link https://learn.microsoft.com/javascript/api/requirement-sets/outlook/preview-requirement-set/office.context.mailbox.item#events | events section}. * * @remarks * [Api set: Mailbox 1.7] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Message 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 - 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 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. */ 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 only available with task pane implementation. * * For supported events, refer to the Item object model * {@link https://learn.microsoft.com/javascript/api/requirement-sets/outlook/preview-requirement-set/office.context.mailbox.item#events | events section}. * * @remarks * [Api set: Mailbox 1.7] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Message 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; /** * Displays a reply form that includes either the sender and all recipients of the selected message or the organizer and all attendees of the * selected appointment. * * @remarks * [Api set: Mailbox 1.1] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Appointment Attendee * * **Important**: * * - 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-column 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 attempts 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. * * - This method isn't supported in Outlook on Android or on iOS. For more information on supported APIs in Outlook mobile, see * {@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-mobile-apis | Outlook JavaScript APIs supported in Outlook on mobile devices}. * * @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. */ displayReplyAllForm(formData: string | ReplyFormData): void; /** * Displays a reply form that includes either 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-column or 1-column view. * * If any of the string parameters exceed their limits, `displayReplyAllFormAsync` throws an exception. * * When attachments are specified in the `formData.attachments` parameter, Outlook attempts 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 * [Api set: Mailbox 1.9] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Message 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 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 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. */ displayReplyAllFormAsync(formData: string | ReplyFormData, options: Office.AsyncContextOptions, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Displays a reply form that includes either 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-column or 1-column view. * * If any of the string parameters exceed their limits, `displayReplyAllFormAsync` throws an exception. * * When attachments are specified in the `formData.attachments` parameter, Outlook attempts 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 * [Api set: Mailbox 1.9] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Message 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. */ displayReplyAllFormAsync(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. * * @remarks * [Api set: Mailbox 1.1] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Message Read * * **Important**: * * - 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-column 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 attempts 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. * * - This method isn't supported in Outlook on Android or on iOS. For more information on supported APIs in Outlook mobile, see * {@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-mobile-apis | Outlook JavaScript APIs supported in Outlook on mobile devices}. * * @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. */ displayReplyForm(formData: string | ReplyFormData): 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-column or 1-column view. * * If any of the string parameters exceed their limits, `displayReplyFormAsync` throws an exception. * * When attachments are specified in the `formData.attachments` parameter, Outlook attempts 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 * [Api set: Mailbox 1.9] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Message 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 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 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. */ displayReplyFormAsync(formData: string | ReplyFormData, options: Office.AsyncContextOptions, 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-column or 1-column view. * * If any of the string parameters exceed their limits, `displayReplyFormAsync` throws an exception. * * When attachments are specified in the `formData.attachments` parameter, Outlook attempts 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 * [Api set: Mailbox 1.9] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Message 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. */ displayReplyFormAsync(formData: string | ReplyFormData, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Gets all the internet headers for the message as a string. * * To learn more, see * {@link https://learn.microsoft.com/office/dev/add-ins/outlook/internet-headers | Get and set internet headers on a message in an Outlook add-in}. * * @remarks * [Api set: Mailbox 1.8] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#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 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. * On success, the internet headers data is provided in the `asyncResult.value` property as a string. * Refer to {@link https://tools.ietf.org/html/rfc2183 | RFC 2183} for the formatting information of the returned string value. * If the call fails, the `asyncResult.error` property will contain an error code with the reason for the failure. */ getAllInternetHeadersAsync(options: Office.AsyncContextOptions, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Gets all the internet headers for the message as a string. * * To learn more, see * {@link https://learn.microsoft.com/office/dev/add-ins/outlook/internet-headers | Get and set internet headers on a message in an Outlook add-in}. * * @remarks * [Api set: Mailbox 1.8] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Message 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 internet headers data is provided in the `asyncResult.value` property as a string. * Refer to {@link https://tools.ietf.org/html/rfc2183 | RFC 2183} for the formatting information of the returned string value. * 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 the current message in EML format encoded in Base64. * * @remarks * [Api set: Mailbox preview] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#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 function. * @param callback - When the method completes, the function passed in the callback parameter is called with a single parameter, `asyncResult`, which is an * `Office.AsyncResult` object. The Base64-encoded EML format of the message is returned in the `asyncResult.value` property. Any errors encountered are * returned in the `asyncResult.error` property. * * @beta */ getAsFileAsync(options: Office.AsyncContextOptions, callback: (asyncResult: Office.AsyncResult) => void): void; /** * Gets the current message in EML format encoded in Base64. * * @remarks * [Api set: Mailbox preview] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#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, `asyncResult`, which is an * `Office.AsyncResult` object. The Base64-encoded EML format of the message is returned in the `asyncResult.value` property. Any errors encountered are * returned in the `asyncResult.error` property. * * @beta */ getAsFileAsync(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 get * the attachment's identifier from an {@link Office.MessageRead.attachments | item.attachments} call, then in the same session, use that identifier * to retrieve the attachment. 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. * * @remarks * [Api set: Mailbox 1.8] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Message Read * * **Errors**: * * - `AttachmentTypeNotSupported`: The attachment type isn't supported. Unsupported types include embedded images in Rich Text Format, * or item attachment types other than email or calendar items (such as a contact or task item). * * - `InvalidAttachmentId`: The attachment identifier does not exist. * * @param attachmentId - The identifier of the attachment you want to get. * @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 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. If the call fails, the `asyncResult.error` property will contain * an 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 get * the attachment's identifier from an {@link Office.MessageRead.attachments | item.attachments} call, then in the same session, use that identifier * to retrieve the attachment. 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. * * @remarks * [Api set: Mailbox 1.8] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Message Read * * **Errors**: * * - `AttachmentTypeNotSupported`: The attachment type isn't supported. Unsupported types include embedded images in Rich Text Format, * or item attachment types other than email or calendar items (such as a contact or task item). * * - `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 * an 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. * * @remarks * [Api set: Mailbox 1.1] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Appointment Attendee * * **Important**: This method isn't supported in Outlook on Android or on iOS. For more information on supported APIs in Outlook mobile, see * {@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-mobile-apis | Outlook JavaScript APIs supported in Outlook on mobile devices}. */ getEntities(): Entities; /** * Gets an array of all the entities of the specified entity type found in the selected item's body. * * @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 * [Api set: Mailbox 1.1] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **restricted** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Message Read * * **Important**: This method isn't supported in Outlook on Android or on iOS. For more information on supported APIs in Outlook mobile, see * {@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-mobile-apis | Outlook JavaScript APIs supported in Outlook on mobile devices}. * * @param entityType - One of the `EntityType` enumeration values. * * While the minimum permission level to use this method is **restricted**, some entity types require **read item** 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 an XML manifest file. * * @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. If there's no `ItemHasKnownEntity` element in the manifest with a * `FilterName` element value that matches the `name` parameter, the method returns `null`. If the `name` parameter matches an * `ItemHasKnownEntity` element in the manifest, but there are no entities in the current item that match, the method returns an empty array. * * @remarks * [Api set: Mailbox 1.1] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Appointment Attendee * * **Important**: * * - This method is used with the {@link https://learn.microsoft.com/office/dev/add-ins/outlook/activation-rules | activation rules feature for Outlook add-ins}, * which isn't supported by the {@link https://learn.microsoft.com/office/dev/add-ins/develop/json-manifest-overview | Teams manifest for Office Add-ins (preview)}. * * - This method isn't supported in Outlook on Android or on iOS. For more information on supported APIs in Outlook mobile, see * {@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-mobile-apis | Outlook JavaScript APIs supported in Outlook on mobile devices}. * * @param name - The name of the `ItemHasKnownEntity` rule element that defines the filter to match. */ getFilteredEntitiesByName(name: string): (string | Contact | MeetingSuggestion | PhoneNumber | TaskSuggestion)[]; /** * Gets initialization data passed when the add-in is {@link https://learn.microsoft.com/outlook/actionable-messages/invoke-add-in | activated by an actionable message}. * * @remarks * [Api set: Mailbox 1.8] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#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 function. * @param callback - 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 context data is provided as a string (or an empty string if there's no initialization context) * in the `asyncResult.value` property. */ getInitializationContextAsync(options: Office.AsyncContextOptions, callback: (asyncResult: Office.AsyncResult) => void): void; /** * Gets initialization data passed when the add-in is {@link https://learn.microsoft.com/outlook/actionable-messages/invoke-add-in | activated by an actionable message}. * * @remarks * [Api set: Mailbox 1.8] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#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`. * On success, the initialization context data is provided as a string (or an empty string if there's no initialization context) * in the `asyncResult.value` property. */ getInitializationContextAsync(callback: (asyncResult: Office.AsyncResult) => void): void; /** * Returns string values in the selected item that match the regular expressions defined in an XML manifest file. * * @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. 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. * * @remarks * [Api set: Mailbox 1.1] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Appointment Attendee * * **Important**: * * - This method is used with the {@link https://learn.microsoft.com/office/dev/add-ins/outlook/activation-rules | activation rules feature for Outlook add-ins}, * which isn't supported by the {@link https://learn.microsoft.com/office/dev/add-ins/develop/json-manifest-overview | Teams manifest for Office Add-ins (preview)}. * * - If you specify an `ItemHasRegularExpressionMatch` rule on the body property of an item, the regular expression should further filter the body * and shouldn't attempt to return the entire body of the item. Using a regular expression such as `.*` to obtain the entire body of an item doesn't always return the expected results. * Instead, use the `Body.getAsync` method to retrieve the entire body. * * - This method isn't supported in Outlook on Android or on iOS. For more information on supported APIs in Outlook mobile, see * {@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-mobile-apis | Outlook JavaScript APIs supported in Outlook on mobile devices}. */ getRegExMatches(): any; /** * Returns string values in the selected item that match the named regular expression defined in an XML manifest file. * * @returns * An array that contains the strings that match the regular expression defined in the `ItemHasRegularExpressionMatch` rule element in the manifest XML file, * with the specified `RegExName` element value. * * @remarks * [Api set: Mailbox 1.1] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Appointment Attendee * * **Important**: * * - This method is used with the {@link https://learn.microsoft.com/office/dev/add-ins/outlook/activation-rules | activation rules feature for Outlook add-ins}, * which isn't supported by the {@link https://learn.microsoft.com/office/dev/add-ins/develop/json-manifest-overview | Teams manifest for Office Add-ins (preview)}. * * - If you specify an `ItemHasRegularExpressionMatch` rule on the body property of an item, the regular expression should further filter the body * and shouldn't attempt to return the entire body of the item. Using a regular expression such as `.*` to obtain the entire body of an item doesn't always return the expected results. * Instead, use the `Body.getAsync` method to retrieve the entire body. * * - This method isn't supported in Outlook on Android or on iOS. For more information on supported APIs in Outlook mobile, see * {@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-mobile-apis | Outlook JavaScript APIs supported in Outlook on mobile devices}. * * @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 used with the {@link https://learn.microsoft.com/office/dev/add-ins/outlook/activation-rules | activation rules feature for Outlook add-ins}, which isn't supported by the {@link https://learn.microsoft.com/office/dev/add-ins/develop/json-manifest-overview | Teams manifest for Office Add-ins (preview)}. * * **Note**: This method is not supported in Outlook on iOS or Android. * * @remarks * [Api set: Mailbox 1.6] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Message 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 an XML manifest file. * Highlighted matches apply to contextual add-ins. * * **Note**: This method is used with the {@link https://learn.microsoft.com/office/dev/add-ins/outlook/activation-rules | activation rules feature for Outlook add-ins}, which isn't supported by the {@link https://learn.microsoft.com/office/dev/add-ins/develop/json-manifest-overview | Teams manifest for Office Add-ins (preview)}. * * 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. * * @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 * [Api set: Mailbox 1.6] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Message Read */ getSelectedRegExMatches(): any; /** * Gets the properties of an appointment or message in a shared folder or shared mailbox. * * For more information around using this API, see * {@link https://learn.microsoft.com/office/dev/add-ins/outlook/delegate-access | Enable shared folders and shared mailbox scenarios in an Outlook add-in}. * * @remarks * [Api set: Mailbox 1.8 for shared folder support, Mailbox 1.13 for shared mailbox support] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Message Read * * **Note**: This method is not supported in Outlook on iOS or Android. * * @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 function. * @param callback - When the method completes, the function passed in the `callback` parameter is called with a single parameter, `asyncResult`, which is an * `Office.AsyncResult` object. The `asyncResult.value` property provides 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 or shared mailbox (now in preview). * * For more information around using this API, see * {@link https://learn.microsoft.com/office/dev/add-ins/outlook/delegate-access | Enable shared folders and shared mailbox scenarios in an Outlook add-in}. * * @remarks * [Api set: Mailbox 1.8 for shared folder support, Mailbox 1.13 for shared mailbox support] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Message Read * * **Note**: This method is not supported in Outlook on iOS or Android. * * @param callback - When the method completes, the function passed in the `callback` parameter is called with a single parameter, `asyncResult`, which is an * `Office.AsyncResult` object. The `asyncResult.value` property provides 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 {@link Office.CustomProperties | 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 aren't encrypted on the item, so this shouldn't 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, save, and remove custom properties from the mail item. * * @remarks * [Api set: Mailbox 1.1] * * To learn more about custom properties, see * {@link https://learn.microsoft.com/office/dev/add-ins/outlook/metadata-for-an-outlook-add-in | Get and set add-in metadata for an Outlook add-in}. * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#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`. * @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 only available with task pane implementation. * * For supported events, refer to the Item object model * {@link https://learn.microsoft.com/javascript/api/requirement-sets/outlook/preview-requirement-set/office.context.mailbox.item#events | events section}. * * @remarks * [Api set: Mailbox 1.7] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Message Read * * @param eventType - The event that should revoke the handler. * @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 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. */ 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 only available with task pane implementation. * * For supported events, refer to the Item object model * {@link https://learn.microsoft.com/javascript/api/requirement-sets/outlook/preview-requirement-set/office.context.mailbox.item#events | events section}. * * @remarks * [Api set: Mailbox 1.7] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Message 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; } /** * Provides methods to get and set the all-day event status of a meeting in an Outlook add-in. * * @remarks * [Api set: Mailbox preview] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose * * @beta */ interface IsAllDayEvent { /** * Gets the boolean value indicating whether the event is all day or not. * * @remarks * [Api set: Mailbox preview] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: 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 function. * @param callback - When the method completes, the function passed in the `callback` parameter is called with a single parameter of * type `Office.AsyncResult`. * * @beta */ getAsync(options: Office.AsyncContextOptions, callback: (asyncResult: Office.AsyncResult) => void): void; /** * Gets the boolean value indicating whether the event is all day or not. * * @remarks * [Api set: Mailbox preview] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose * * @param callback - When the method completes, the function passed in the `callback` parameter is called with a single parameter of * type `Office.AsyncResult`. * * @beta */ getAsync(callback: (asyncResult: Office.AsyncResult) => void): void; /** * Sets the all-day event status of an appointment. * * @remarks * [Api set: Mailbox preview] * * If an appointment is marked as an all-day event: * - Start and end time will be marked as 12:00 AM (just like in the Outlook UI). Start time will return 12:00 AM and end time will be 12:00 AM the next day. * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read/write item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose * * @param isAllDayEvent - boolean value to set the all day event status. * @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 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. * * @beta */ setAsync(isAllDayEvent: boolean, options: Office.AsyncContextOptions, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Sets the all-day event status of an appointment. * * @remarks * [Api set: Mailbox preview] * * If an appointment is marked as an all-day event: * - Start and end time will be marked as 12:00 AM (just like in the Outlook UI). Start time will return 12:00 AM and end time will be 12:00 AM the next day. * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read/write item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose * * @param isAllDayEvent - boolean value to set the all day event status. * @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. * * @beta */ setAsync(isAllDayEvent: boolean, callback?: (asyncResult: Office.AsyncResult) => void): void; } /** * The definition of the action for a notification message. * * **Important**: In modern Outlook on the web, the `NotificationMessageAction` object is available in Compose mode only. * * @remarks * [Api set: Mailbox 1.10] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose or Read */ interface NotificationMessageAction { /** * The type of action to be performed. * `ActionType.ShowTaskPane` is the only supported action. */ actionType: string | MailboxEnums.ActionType; /** * The text of the action link. */ actionText: string; /** * The button defined in the manifest. */ commandId: string; /** * Any JSON data the action button needs to pass on. * This data can be retrieved by calling `item.getInitializationContextAsync`. */ contextData: any; } /** * An array of `NotificationMessageDetails` objects are returned by the `NotificationMessages.getAllAsync` method. * * @remarks * [Api set: Mailbox 1.3] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose or Read */ interface NotificationMessageDetails { /** * The identifier for the notification message. */ key?: string; /** * Specifies the `ItemNotificationMessageType` of message. * * If type is `ProgressIndicator` or `ErrorMessage`, an icon is automatically supplied * and the message is not persistent. Therefore the icon and persistent properties are not valid for these types of messages. * Including them will result in an `ArgumentException`. * * If type is `ProgressIndicator`, the developer should remove or replace the progress indicator when the action is complete. * * **Important**: Only the `InformationalMessage` type is supported in Outlook on Android and on iOS. */ type: MailboxEnums.ItemNotificationMessageType | string; /** * A reference to an icon that is defined in the manifest. It appears in the infobar area. * It is applicable if the type is `InformationalMessage`, and is required if the type is `InsightMessage`. * Specifying this parameter for an unsupported type results in an exception. * * **Note**: At present, the custom icon is displayed in Outlook on Windows only and not on other clients (e.g., Mac, web browser). */ icon?: string; /** * The text of the notification message. Maximum length is 150 characters. * If the developer passes in a longer string, an `ArgumentOutOfRange` exception is thrown. */ message: string; /** * Specifies if the message should be persistent. Only applicable when type is `InformationalMessage`. * If true, the message remains until removed by this add-in or dismissed by the user. * If false, it is removed when the user navigates to a different item. * For error notifications, the message persists until the user sees it once. * Specifying this parameter for an unsupported type throws an exception. */ persistent?: Boolean; /** * Specifies actions for the message. Limit: 1 action. This limit doesn't count the "Dismiss" action which is included by default. * Only applicable when the type is `InsightMessage`. * Specifying this property for an unsupported type or including too many actions throws an error. * * **Important**: In modern Outlook on the web, the `actions` property is available in Compose mode only. * * @remarks * [Api set: Mailbox 1.10] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose or Read */ actions?: NotificationMessageAction[]; } /** * The `NotificationMessages` object is returned as the `notificationMessages` property of an item. * * @remarks * [Api set: Mailbox 1.3] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose or Read */ interface NotificationMessages { /** * Adds a notification to an item. * * There are a maximum of 5 notifications per message. Setting more will return a `NumberOfNotificationMessagesExceeded` error. * * @remarks * [Api set: Mailbox 1.3] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose or Read * * **Important**: * * - Only one notification of type {@link https://learn.microsoft.com/javascript/api/outlook/office.mailboxenums.itemnotificationmessagetype#fields | InsightMessage} * is allowed per add-in. Attempting to add more will throw an error. * * - In modern Outlook on the web, you can add an `InsightMessage` notification only in Compose mode. * * - Only the `InformationalMessage` type is supported in Outlook on Android and on iOS. * * @param key - A developer-specified key used to reference this notification message. * Developers can use it to modify this message later. It can't be longer than 32 characters. * @param JSONmessage - A JSON object that contains the notification message to be added to the item. * It contains a `NotificationMessageDetails` object. * @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 function. * @param callback - Optional. When the method completes, the function passed in the `callback` parameter is called with a single parameter * of type `Office.AsyncResult`. */ addAsync(key: string, JSONmessage: NotificationMessageDetails, options: Office.AsyncContextOptions, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Adds a notification to an item. * * There are a maximum of 5 notifications per message. Setting more will return a `NumberOfNotificationMessagesExceeded` error. * * @remarks * [Api set: Mailbox 1.3] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose or Read * * **Important**: * * - Only one notification of type {@link https://learn.microsoft.com/javascript/api/outlook/office.mailboxenums.itemnotificationmessagetype#fields | InsightMessage} * is allowed per add-in. Attempting to add more will throw an error. * * - In modern Outlook on the web, you can add an `InsightMessage` notification only in Compose mode. * * - Only the `InformationalMessage` type is supported in Outlook on Android and on iOS. * * @param key - A developer-specified key used to reference this notification message. * Developers can use it to modify this message later. It can't be longer than 32 characters. * @param JSONmessage - A JSON object that contains the notification message to be added to the item. * It contains a `NotificationMessageDetails` object. * @param callback - Optional. When the method completes, the function passed in the `callback` parameter is called with a single parameter * of type `Office.AsyncResult`. */ addAsync(key: string, JSONmessage: NotificationMessageDetails, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Returns all keys and messages for an item. * * @remarks * [Api set: Mailbox 1.3] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#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 function. * @param callback - Optional. 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 an array of `NotificationMessageDetails` objects. */ getAllAsync(options: Office.AsyncContextOptions, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Returns all keys and messages for an item. * * @remarks * [Api set: Mailbox 1.3] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#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 * of type `Office.AsyncResult`. The `value` property of the result is an array of `NotificationMessageDetails` objects. */ getAllAsync(callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Removes a notification message for an item. * * @remarks * [Api set: Mailbox 1.3] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose or Read * * @param key - The key for the notification message to remove. * @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 function. * @param callback - Optional. When the method completes, the function passed in the `callback` parameter is called with a single parameter * of type `Office.AsyncResult`. */ removeAsync(key: string, options: Office.AsyncContextOptions, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Removes a notification message for an item. * * @remarks * [Api set: Mailbox 1.3] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose or Read * * @param key - The key for the notification message 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`. */ removeAsync(key: string, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Replaces a notification message that has a given key with another message. * * If a notification message with the specified key doesn't exist, `replaceAsync` will add the notification. * * @remarks * [Api set: Mailbox 1.3] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose or Read * * @param key - The key for the notification message to replace. It can't be longer than 32 characters. * @param JSONmessage - A JSON object that contains the new notification message to replace the existing message. * It contains a `NotificationMessageDetails` object. * @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 function. * @param callback - Optional. When the method completes, the function passed in the `callback` parameter is called with a single parameter * of type `Office.AsyncResult`. */ replaceAsync(key: string, JSONmessage: NotificationMessageDetails, options: Office.AsyncContextOptions, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Replaces a notification message that has a given key with another message. * * If a notification message with the specified key doesn't exist, `replaceAsync` will add the notification. * * @remarks * [Api set: Mailbox 1.3] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose or Read * * @param key - The key for the notification message to replace. It can't be longer than 32 characters. * @param JSONmessage - A JSON object that contains the new notification message to replace the existing message. * It contains a `NotificationMessageDetails` object. * @param callback - Optional. When the method completes, the function passed in the `callback` parameter is called with a single parameter * of type `Office.AsyncResult`. */ replaceAsync(key: string, JSONmessage: NotificationMessageDetails, callback?: (asyncResult: Office.AsyncResult) => void): void; } /** * Provides the updated Office theme that raised the `Office.EventType.OfficeThemeChanged` event. * * @remarks * [Api set: Mailbox preview] * * @beta */ export interface OfficeThemeChangedEventArgs { /** * Gets the updated Office theme. * * @remarks * [Api set: Mailbox preview] * * @beta */ officeTheme: Office.OfficeTheme; /** * Gets the type of the event. For details, refer to {@link https://learn.microsoft.com/javascript/api/office/office.eventtype | Office.EventType}. * * @remarks * [Api set: Mailbox preview] * * @beta */ type: "officeThemeChanged"; } /** * Represents the appointment organizer, even if an alias or a delegate was used to create the appointment. * This object provides a method to get the organizer value of an appointment in an Outlook add-in. * * @remarks * [Api set: Mailbox 1.7] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose */ interface Organizer { /** * Gets the organizer value of an appointment as an {@link Office.EmailAddressDetails | EmailAddressDetails} object * in the `asyncResult.value` property. * * @remarks * [Api set: Mailbox 1.7] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose * * **Important**: A `recipientType` property value isn't returned by the getAsync method. * The appointment organizer is always a user whose email address is on the Exchange server. * * @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 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 `AsyncResult` object. The `value` property of the result is the appointment's organizer value, * as an `EmailAddressDetails` object. */ getAsync(options: Office.AsyncContextOptions, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Gets the organizer value of an appointment as an {@link Office.EmailAddressDetails | EmailAddressDetails} object * in the `asyncResult.value` property. * * @remarks * [Api set: Mailbox 1.7] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose * * **Important**: A `recipientType` property value isn't returned by the getAsync method. * The appointment organizer is always a user whose email address is on the Exchange server. * * @param callback - Optional. When the method completes, the function passed in the `callback` parameter is called with a single parameter, * `asyncResult`, which is an `AsyncResult` object. The `value` property of the result is the appointment's organizer value, * as an `EmailAddressDetails` object. */ getAsync(callback?: (asyncResult: Office.AsyncResult) => void): void; } /** * Represents a phone number identified in an item. Read mode only. * * An array of `PhoneNumber` objects containing the phone numbers found in an email message is returned in the `phoneNumbers` property of the * `Entities` object that is returned when you call the `getEntities` method on the selected item. * * @remarks * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Read */ interface PhoneNumber { /** * Gets a string containing a phone number. This string contains only the digits of the telephone number and excludes characters * like parentheses and hyphens, if they exist in the original item. */ phoneString: string; /** * Gets the text that was identified in an item as a phone number. */ originalPhoneString: string; /** * Gets a string that identifies the type of phone number: Home, Work, Mobile, Unspecified. */ type: string; } /** * Represents recipients of an item. Compose mode only. * * @remarks * [Api set: Mailbox 1.1] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose */ interface Recipients { /** * Adds a recipient list to the existing recipients for an appointment or message. * * @remarks * [Api set: Mailbox 1.1] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read/write item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose * * **Important**: With the `addAsync` method, you can add a maximum of 100 recipients to a mail item in Outlook on Windows, on Mac (classic UI), * on the web, on Android, and on iOS. However, take note of the following: * * - In Outlook on Windows, on Mac (classic UI), and on the web, you can have a maximum of 500 recipients in a target field. * If you need to add more than 100 recipients to a mail item, you can call `addAsync` repeatedly, but be mindful of the recipient limit of the field. * * - In Outlook on Android and on iOS, the `addAsync` method isn't supported in Message Compose mode. Only the Appointment Organizer mode is * supported. For more information on supported APIs in Outlook mobile, see * {@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-mobile-apis | Outlook JavaScript APIs supported in Outlook on mobile devices}. * * There's no recipient limit if you call `addAsync` in Outlook on Mac (new UI). * * **Errors**: * * - `NumberOfRecipientsExceeded`: The number of recipients exceeded 100 entries. * * @param recipients - The recipients to add to the recipients list. The array of recipients can contain strings of SMTP email addresses, * {@link Office.EmailUser | EmailUser} objects, or {@link Office.EmailAddressDetails | EmailAddressDetails} objects. * @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 function. * @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 adding the recipients fails, the `asyncResult.error` property will contain an error code. */ addAsync(recipients: (string | EmailUser | EmailAddressDetails)[], options: Office.AsyncContextOptions, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Adds a recipient list to the existing recipients for an appointment or message. * * @remarks * [Api set: Mailbox 1.1] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read/write item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose * * **Important**: With the `addAsync` method, you can add a maximum of 100 recipients to a mail item in Outlook on Windows, on Mac (classic UI), * on the web, on Android, and on iOS. However, take note of the following: * * - In Outlook on Windows, on Mac (classic UI), and on the web, you can have a maximum of 500 recipients in a target field. * If you need to add more than 100 recipients to a mail item, you can call `addAsync` repeatedly, but be mindful of the recipient limit of the field. * * - In Outlook on Android and on iOS, the `addAsync` method isn't supported in Message Compose mode. Only the Appointment Organizer mode is * supported. For more information on supported APIs in Outlook mobile, see * {@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-mobile-apis | Outlook JavaScript APIs supported in Outlook on mobile devices}. * * There's no recipient limit if you call `addAsync` in Outlook on Mac (new UI). * * **Errors**: * * - `NumberOfRecipientsExceeded`: The number of recipients exceeded 100 entries. * * @param recipients - The recipients to add to the recipients list. The array of recipients can contain strings of SMTP email addresses, * {@link Office.EmailUser | EmailUser} objects, or {@link Office.EmailAddressDetails | EmailAddressDetails} objects. * @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 adding the recipients fails, the `asyncResult.error` property will contain an error code. */ addAsync(recipients: (string | EmailUser | EmailAddressDetails)[], callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Gets a recipient list for an appointment or message. * * @remarks * [Api set: Mailbox 1.1] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose * * **Important**: * * The maximum number of recipients returned by this method varies per Outlook client. * * - Windows, web browser, Mac (classic UI): 500 recipients * * - Android, iOS: 100 recipients * * - Mac (new UI): No limit * * The `getAsync` method only returns recipients resolved by the Outlook client. A resolved recipient has the following characteristics. * * - If the recipient has a saved entry in the sender's address book, Outlook resolves the email address to the recipient's saved display name. * * - A Teams meeting status icon appears before the recipient's name or email address. * * - A semicolon appears after the recipient's name or email address. * * - The recipient's name or email address is underlined or enclosed in a box. * * To resolve an email address once it's added to a mail item, the sender must use the **Tab** key or select a suggested contact or email address from * the auto-complete list. * * In Outlook on the web and on Windows, if a user creates a new message by activating a contact's email address link from their contact * or profile card, your add-in's `Recipients.getAsync` call returns the contact's email address in the `displayName` property of the associated * {@link Office.EmailAddressDetails | EmailAddressDetails} object instead of the contact's saved name. For more details, see * {@link https://github.com/OfficeDev/office-js/issues/2201 | related GitHub issue}. * * @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 function. * @param callback - When the method completes, the function passed in the `callback` parameter is called with a single parameter, `asyncResult`, * of type `Office.AsyncResult`. The `asyncResult.value` property of the result is an array of * {@link Office.EmailAddressDetails | EmailAddressDetails} objects. */ getAsync(options: Office.AsyncContextOptions, callback: (asyncResult: Office.AsyncResult) => void): void; /** * Gets a recipient list for an appointment or message. * * @remarks * [Api set: Mailbox 1.1] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose * * **Important**: * * The maximum number of recipients returned by this method varies per Outlook client. * * - Windows, web browser, Mac (classic UI): 500 recipients * * - Android, iOS: 100 recipients * * - Mac (new UI): No limit * * The `getAsync` method only returns recipients resolved by the Outlook client. A resolved recipient has the following characteristics. * * - If the recipient has a saved entry in the sender's address book, Outlook resolves the email address to the recipient's saved display name. * * - A Teams meeting status icon appears before the recipient's name or email address. * * - A semicolon appears after the recipient's name or email address. * * - The recipient's name or email address is underlined or enclosed in a box. * * To resolve an email address once it's added to a mail item, the sender must use the **Tab** key or select a suggested contact or email address from * the auto-complete list. * * In Outlook on the web and on Windows, if a user creates a new message by activating a contact's email address link from their contact * or profile card, your add-in's `Recipients.getAsync` call returns the contact's email address in the `displayName` property of the associated * {@link Office.EmailAddressDetails | EmailAddressDetails} object instead of the contact's saved name. For more details, see * {@link https://github.com/OfficeDev/office-js/issues/2201 | related GitHub issue}. * * @param callback - When the method completes, the function passed in the `callback` parameter is called with a single parameter, `asyncResult`, * of type `Office.AsyncResult`. The `asyncResult.value` property of the result is an array of * {@link Office.EmailAddressDetails | EmailAddressDetails} objects. */ getAsync(callback: (asyncResult: Office.AsyncResult) => void): void; /** * Sets a recipient list for an appointment or message. * * The `setAsync` method overwrites the current recipient list. * * @remarks * [Api set: Mailbox 1.1] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read/write item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose * * **Important**: With the `setAsync` method, you can set a maximum of 100 recipients in Outlook on Windows, on Mac (classic UI), * on the web, on Android, and on iOS. However, take note of the following: * * - In Outlook on Windows, on Mac (classic UI), and on the web, you can have a maximum of 500 recipients in a target field. * If you need to set more than 100 recipients, you can call `setAsync` repeatedly, but be mindful of the recipient limit of the field. * * - In Outlook on Android and on iOS, the `setAsync` method isn't supported in the Message Compose mode. Only the Appointment Organizer mode is * supported. For more information on supported APIs in Outlook mobile, see * {@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-mobile-apis | Outlook JavaScript APIs supported in Outlook on mobile devices}. * * There's no recipient limit if you call `setAsync` in Outlook on Mac (new UI). * * **Errors**: * * - `NumberOfRecipientsExceeded`: The number of recipients exceeded 100 entries. * * @param recipients - The recipients to add to the recipients list. The array of recipients can contain strings of SMTP email addresses, * {@link Office.EmailUser | EmailUser} objects, or {@link Office.EmailAddressDetails | EmailAddressDetails} objects. * @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 function. * @param callback - When the method completes, the function passed in the `callback` parameter is called with a single parameter of * type `Office.AsyncResult`. If setting the recipients fails the `asyncResult.error` property will contain a code that * indicates any error that occurred while adding the data. */ setAsync(recipients: (string | EmailUser | EmailAddressDetails)[], options: Office.AsyncContextOptions, callback: (asyncResult: Office.AsyncResult) => void): void; /** * Sets a recipient list for an appointment or message. * * The `setAsync` method overwrites the current recipient list. * * @remarks * [Api set: Mailbox 1.1] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read/write item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose * * **Important**: With the `setAsync` method, you can set a maximum of 100 recipients in Outlook on Windows, on Mac (classic UI), * on the web, on Android, and on iOS. However, take note of the following: * * - In Outlook on Windows, on Mac (classic UI), and on the web, you can have a maximum of 500 recipients in a target field. * If you need to set more than 100 recipients, you can call `setAsync` repeatedly, but be mindful of the recipient limit of the field. * * - In Outlook on Android and on iOS, the `setAsync` method isn't supported in the Message Compose mode. Only the Appointment Organizer mode is * supported. For more information on supported APIs in Outlook mobile, see * {@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-mobile-apis | Outlook JavaScript APIs supported in Outlook on mobile devices}. * * There's no recipient limit if you call `setAsync` in Outlook on Mac (new UI). * * **Errors**: * * - `NumberOfRecipientsExceeded`: The number of recipients exceeded 100 entries. * * @param recipients - The recipients to add to the recipients list. The array of recipients can contain strings of SMTP email addresses, * {@link Office.EmailUser | EmailUser} objects, or {@link Office.EmailAddressDetails | EmailAddressDetails} objects. * @param callback - When the method completes, the function passed in the `callback` parameter is called with a single parameter of * type `Office.AsyncResult`. If setting the recipients fails the `asyncResult.error` property will contain a code that * indicates any error that occurred while adding the data. */ setAsync(recipients: (string | EmailUser | EmailAddressDetails)[], callback: (asyncResult: Office.AsyncResult) => void): void; } /** * Provides change status of recipients fields when the `Office.EventType.RecipientsChanged` event is raised. * * @remarks * [Api set: Mailbox 1.7] */ export interface RecipientsChangedEventArgs { /** * Gets an object that indicates change state of recipients fields. * * @remarks * [Api set: Mailbox 1.7] */ changedRecipientFields: RecipientsChangedFields; /** * Gets the type of the event. For details, refer to {@link https://learn.microsoft.com/javascript/api/office/office.eventtype | Office.EventType}. * * @remarks * [Api set: Mailbox 1.7] */ type: "olkRecipientsChanged"; } /** * Represents `RecipientsChangedEventArgs.changedRecipientFields` object. * * @remarks * [Api set: Mailbox 1.7] */ interface RecipientsChangedFields { /** * Gets if recipients in the **bcc** field were changed. * * @remarks * [Api set: Mailbox 1.7] */ bcc: boolean /** * Gets if recipients in the **cc** field were changed. * * @remarks * [Api set: Mailbox 1.7] */ cc: boolean; /** * Gets if optional attendees were changed. * * @remarks * [Api set: Mailbox 1.7] */ optionalAttendees: boolean; /** * Gets if required attendees were changed. * * @remarks * [Api set: Mailbox 1.7] */ requiredAttendees: boolean; /** * Gets if resources were changed. * * @remarks * [Api set: Mailbox 1.7] */ resources: boolean; /** * Gets if recipients in the **to** field were changed. * * @remarks * [Api set: Mailbox 1.7] */ to: boolean; } /** * The `Recurrence` object provides methods to get and set the recurrence pattern of appointments but only get the recurrence pattern of * meeting requests. * It will have a dictionary with the following keys: `seriesTime`, `recurrenceType`, `recurrenceProperties`, and `recurrenceTimeZone` (optional). * * @remarks * [Api set: Mailbox 1.7] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose or Read * * **States** * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
StateEditable?Viewable?
Appointment Organizer - Compose SeriesYes (setAsync)Yes (getAsync)
Appointment Organizer - Compose InstanceNo (setAsync returns error)Yes (getAsync)
Appointment Attendee - Read SeriesNo (setAsync not available)Yes (item.recurrence)
Appointment Attendee - Read InstanceNo (setAsync not available)Yes (item.recurrence)
Meeting Request - Read SeriesNo (setAsync not available)Yes (item.recurrence)
Meeting Request - Read InstanceNo (setAsync not available)Yes (item.recurrence)
*/ interface Recurrence { /** * Gets or sets the properties of the recurring appointment series. * * @remarks * [Api set: Mailbox 1.7] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose or Read */ recurrenceProperties?: RecurrenceProperties; /** * Gets or sets the properties of the recurring appointment series. * * @remarks * [Api set: Mailbox 1.7] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose or Read */ recurrenceTimeZone?: RecurrenceTimeZone; /** * Gets or sets the type of the recurring appointment series. * * @remarks * [Api set: Mailbox 1.7] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose or Read */ recurrenceType: MailboxEnums.RecurrenceType | string; /** * The {@link Office.SeriesTime | SeriesTime} object enables you to manage the start and end dates of the recurring appointment series and * the usual start and end times of instances. **This object is not in UTC time.** * Instead, it is set in the time zone specified by the `recurrenceTimeZone` value or defaulted to the item's time zone. * * @remarks * [Api set: Mailbox 1.7] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose or Read */ seriesTime: SeriesTime; /** * Returns the current recurrence object of an appointment series. * * This method returns the entire `Recurrence` object for the appointment series. * * @remarks * [Api set: Mailbox 1.7] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#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 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. The `value` property of the result is a `Recurrence` object. */ getAsync(options: Office.AsyncContextOptions, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Returns the current recurrence object of an appointment series. * * This method returns the entire `Recurrence` object for the appointment series. * * @remarks * [Api set: Mailbox 1.7] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#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. The `value` property of the result is a `Recurrence` object. */ getAsync(callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Sets the recurrence pattern of an appointment series. * * **Note**: `setAsync` should only be available for series items and not instance items. * * @remarks * [Api set: Mailbox 1.7] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read/write item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose * * **Errors**: * * - `InvalidEndTime`: The appointment end time is before its start time. * * @param recurrencePattern - A recurrence object. * @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 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. */ setAsync(recurrencePattern: Recurrence, options: Office.AsyncContextOptions, callback?: (asyncResult: Office.AsyncResult) => void): void; /** * Sets the recurrence pattern of an appointment series. * * **Note**: `setAsync` should only be available for series items and not instance items. * * @remarks * [Api set: Mailbox 1.7] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read/write item** * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose * * **Errors**: * * - `InvalidEndTime`: The appointment end time is before its start time. * * @param recurrencePattern - A recurrence object. * @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. */ setAsync(recurrencePattern: Recurrence, callback?: (asyncResult: Office.AsyncResult) => void): void; } /** * Provides updated recurrence object that raised the `Office.EventType.RecurrenceChanged` event. * * @remarks * [Api set: Mailbox 1.7] */ export interface RecurrenceChangedEventArgs { /** * Gets the updated recurrence object. * * @remarks * [Api set: Mailbox 1.7] */ recurrence: Recurrence; /** * Gets the type of the event. For details, refer to {@link https://learn.microsoft.com/javascript/api/office/office.eventtype | Office.EventType}. * * @remarks * [Api set: Mailbox 1.7] */ type: "olkRecurrenceChanged"; } /** * Represents the properties of the recurrence. * * @remarks * [Api set: Mailbox 1.7] * * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/unders