AsyncResult.status property (JavaScript API for Office v1.1)

JavaScript API for Office v1.1

Gets the status of the asynchronous operation.

Last modified: June 12, 2014

var myStatus = asyncResult.status;

function getData() {
    Office.context.document.getSelectedDataAsync(Office.CoercionType.Table, function(asyncResult) {
        if (asyncResult.status == Office.AsyncResultStatus.Failed) {
            write(asyncResult.error.message);
        }
        else {
            write(asyncResult.value);
        }
    });
}
// Function that writes to a div with id='message' on the page.
function write(message){
    document.getElementById('message').innerText += message; 
}

App types

Content app, Mail app, Task pane app

Supported clients

Access app for SharePoint, Excel 2013, Excel 2013 SP1, Excel 2013 RT, Excel Online, Word 2013, Word 2013 SP1, Word 2013 RT, Outlook 2013, Outlook 2013 SP1, Outlook 2013 RT, Outlook Web App, OWA for Devices, PowerPoint 2013, PowerPoint 2013 SP1, PowerPoint 2013 RT, Project 2013, and Project 2013 SP1

Library

Office.js

Namespace

Office

Show:
© 2014 Microsoft