Office.EnhancedLocation interface

Represents the set of locations on an appointment.

[ API set: Mailbox 1.8 ]

Remarks

Minimum permission level: ReadItem

Applicable Outlook mode: Compose or Read

Methods

addAsync(locationIdentifiers, options, callback)

Adds to the set of locations associated with the appointment.

[ API set: Mailbox 1.8 ]

addAsync(locationIdentifiers, callback)

Adds to the set of locations associated with the appointment.

[ API set: Mailbox 1.8 ]

getAsync(options, callback)

Gets the set of locations associated with the appointment.

[ API set: Mailbox 1.8 ]

getAsync(callback)

Gets the set of locations associated with the appointment.

[ API set: Mailbox 1.8 ]

removeAsync(locationIdentifiers, options, callback)

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.

[ API set: Mailbox 1.8 ]

removeAsync(locationIdentifiers, callback)

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.

[ API set: Mailbox 1.8 ]

Method Details

addAsync(locationIdentifiers, options, callback)

Adds to the set of locations associated with the appointment.

[ API set: Mailbox 1.8 ]

addAsync(locationIdentifiers: LocationIdentifier[], options?: Office.AsyncContextOptions, callback?: (asyncResult: Office.AsyncResultStatus) => void): void;

Parameters

locationIdentifiers
LocationIdentifier[]

The locations to be added to the current list of locations.

options
Office.AsyncContextOptions

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

callback
(asyncResult: Office.AsyncResultStatus) => void

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.

Returns

void

Remarks

Minimum permission level: ReadWriteItem

Applicable Outlook mode: Compose

Errors:

  • InvalidFormatError: The format of the specified data object is not valid.

addAsync(locationIdentifiers, callback)

Adds to the set of locations associated with the appointment.

[ API set: Mailbox 1.8 ]

addAsync(locationIdentifiers: LocationIdentifier[], callback?: (asyncResult: Office.AsyncResultStatus) => void): void;

Parameters

locationIdentifiers
LocationIdentifier[]

The locations to be added to the current list of locations.

callback
(asyncResult: Office.AsyncResultStatus) => void

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.

Returns

void

Remarks

Minimum permission level: ReadWriteItem

Applicable Outlook mode: Compose

Errors:

  • InvalidFormatError: The format of the specified data object is not valid.

Examples

var locations = [
    {
        "id": "Contoso",
        "type": Office.MailboxEnums.LocationType.Custom
    }
];
Office.context.mailbox.item.enhancedLocation.addAsync(locations);

getAsync(options, callback)

Gets the set of locations associated with the appointment.

[ API set: Mailbox 1.8 ]

getAsync(options?: Office.AsyncContextOptions, callback?: (asyncResult: Office.AsyncResult<LocationDetails[]>) => void): void;

Parameters

options
Office.AsyncContextOptions

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

callback
(asyncResult: Office.AsyncResult<LocationDetails>) => void[]

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.

Returns

void

Remarks

Minimum permission level: ReadItem

Applicable Outlook mode: Compose or Read

getAsync(callback)

Gets the set of locations associated with the appointment.

[ API set: Mailbox 1.8 ]

getAsync(callback?: (asyncResult: Office.AsyncResult<LocationDetails[]>) => void): void;

Parameters

callback
(asyncResult: Office.AsyncResult<LocationDetails>) => void[]

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.

Returns

void

Remarks

Minimum permission level: ReadItem

Applicable Outlook mode: Compose or Read

Examples

Office.context.mailbox.item.enhancedLocation.getAsync(callbackFunction);

function callbackFunction(asyncResult) {
    asyncResult.value.forEach(function (place) {
        console.log("Display name: " + place.displayName);
        console.log("Type: " + place.locationIdentifier.type);
        if (place.locationIdentifier.type === Office.MailboxEnums.LocationType.Room) {
            console.log("Email address: " + place.emailAddress);
        }
    });
}

removeAsync(locationIdentifiers, options, callback)

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.

[ API set: Mailbox 1.8 ]

removeAsync(locationIdentifiers: LocationIdentifier[], options?: Office.AsyncContextOptions, callback?: (asyncResult: Office.AsyncResultStatus) => void): void;

Parameters

locationIdentifiers
LocationIdentifier[]

The locations to be removed from the current list of locations.

options
Office.AsyncContextOptions

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

callback
(asyncResult: Office.AsyncResultStatus) => void

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.

Returns

void

Remarks

Minimum permission level: ReadWriteItem

Applicable Outlook mode: Compose

removeAsync(locationIdentifiers, callback)

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.

[ API set: Mailbox 1.8 ]

removeAsync(locationIdentifiers: LocationIdentifier[], callback?: (asyncResult: Office.AsyncResultStatus) => void): void;

Parameters

locationIdentifiers
LocationIdentifier[]

The locations to be removed from the current list of locations.

callback
(asyncResult: Office.AsyncResultStatus) => void

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.

Returns

void

Remarks

Minimum permission level: ReadWriteItem

Applicable Outlook mode: Compose

Examples

Office.context.mailbox.item.enhancedLocation.getAsync(callbackFunction);

function callbackFunction(asyncResult) {
    asyncResult.value.forEach(function (currentValue) {
        Office.context.mailbox.item.enhancedLocation.removeAsync([currentValue.locationIdentifier]);
    });
}