Office.From interface

Provides a method to get the from value of a message in an Outlook add-in.

Remarks

[ API set: Mailbox 1.7 ]

Minimum permission level: read item

Applicable Outlook mode: Compose

Important: This interface is supported in Outlook on Android and on iOS. For a sample scenario, see Implement event-based activation in Outlook mobile add-ins.

Methods

getAsync(options, callback)

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 EmailAddressDetails in the asyncResult.value property.

getAsync(callback)

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 EmailAddressDetails in the asyncResult.value property.

Method Details

getAsync(options, callback)

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 EmailAddressDetails in the asyncResult.value property.

getAsync(options: Office.AsyncContextOptions, callback?: (asyncResult: Office.AsyncResult<EmailAddressDetails>) => 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 function.

callback

(asyncResult: Office.AsyncResult<Office.EmailAddressDetails>) => 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. The value property of the result is the item's from value, as an EmailAddressDetails object.

Returns

void

Remarks

[ API set: Mailbox 1.7 ]

Minimum permission level: read item

Applicable Outlook mode: Compose

Important:

Examples

// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/outlook/30-recipients-and-attendees/get-from-message-compose.yaml

Office.context.mailbox.item.from.getAsync(function(asyncResult) {
  if (asyncResult.status === Office.AsyncResultStatus.Succeeded) {
    const msgFrom = asyncResult.value;
    console.log("Message from: " + msgFrom.displayName + " (" + msgFrom.emailAddress + ")");
  } else {
    console.error(asyncResult.error);
  }
});

getAsync(callback)

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 EmailAddressDetails in the asyncResult.value property.

getAsync(callback?: (asyncResult: Office.AsyncResult<EmailAddressDetails>) => void): void;

Parameters

callback

(asyncResult: Office.AsyncResult<Office.EmailAddressDetails>) => 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. The value property of the result is the item's from value, as an EmailAddressDetails object.

Returns

void

Remarks

[ API set: Mailbox 1.7 ]

Minimum permission level: read item

Applicable Outlook mode: Compose

Important: