Office.AsyncResultStatus enum

Specifies the result of an asynchronous call.

Remarks

Returned by the status property of the AsyncResult object.

Examples

// The following example logs selected text in a document to the console.
Office.context.document.getSelectedDataAsync(
    Office.CoercionType.Text,
    {
        valueFormat: Office.ValueFormat.Unformatted,
        filterType: Office.FilterType.All
    },
    (result) => {
        if (result.status === Office.AsyncResultStatus.Failed) {
            console.log(result.error.message);
            return;
        }

        console.log(`Selected data: ${result.value}`);
    }
);

Fields

Failed

The call failed, check the error object.

Succeeded

The call succeeded.