Office.Subject interface

Provides methods to get and set the subject of an appointment or message in an Outlook add-in.

[ API set: Mailbox 1.1 ]

Remarks

Minimum permission levelReadItem
Applicable Outlook modeCompose

Methods

getAsync(options, callback)

Gets the subject of an appointment or message.

The getAsync method starts an asynchronous call to the Exchange server to get the subject of an appointment or message.

[ API set: Mailbox 1.1 ]

setAsync(subject, options, callback)

Sets the subject of an appointment or message.

The setAsync method starts an asynchronous call to the Exchange server to set the subject of an appointment or message. Setting the subject overwrites the current subject, but leaves any prefixes, such as "Fwd:" or "Re:" in place.

[ API set: Mailbox 1.1 ]

Method Details

getAsync(options, callback)

Gets the subject of an appointment or message.

The getAsync method starts an asynchronous call to the Exchange server to get the subject of an appointment or message.

[ API set: Mailbox 1.1 ]

getAsync(options: Office.AsyncContextOptions, callback: (result: AsyncResult) => void): void;
Parameters
options
Office.AsyncContextOptions

An object literal that contains one or more of the following properties. asyncContext: Developers can provide any object they wish to access in the callback method.

callback
(result: AsyncResult) => void

When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult.

Returns
void
Remarks
Minimum permission levelReadItem
Applicable Outlook modeCompose

In addition to the main signature, this method also has this signature:

getAsync(callback: (result: AsyncResult) => void): void;

setAsync(subject, options, callback)

Sets the subject of an appointment or message.

The setAsync method starts an asynchronous call to the Exchange server to set the subject of an appointment or message. Setting the subject overwrites the current subject, but leaves any prefixes, such as "Fwd:" or "Re:" in place.

[ API set: Mailbox 1.1 ]

setAsync(subject: string, options?: Office.AsyncContextOptions, callback?: (result: AsyncResult) => void): void;
Parameters
subject
string

The subject of the appointment or message. The string is limited to 255 characters.

options
Office.AsyncContextOptions

An object literal that contains one or more of the following properties. asyncContext: Developers can provide any object they wish to access in the callback method.

callback
(result: AsyncResult) => void

When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. If setting the subject fails, the asyncResult.error property will contain an error code.

Returns
void
Remarks
Minimum permission levelReadItem
Applicable Outlook modeCompose
ErrorsDataExceedsMaximumSize - The subject parameter is longer than 255 characters.

In addition to the main signature, this method also has these signatures:

setAsync(subject: string): void;

setAsync(subject: string, options: Office.AsyncContextOptions): void;

setAsync(subject: string, callback: (result: AsyncResult) => void): void;