Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

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

JavaScript API for Office v1.1

Gets an Error object that provides a description of the error, if any error occurred.

Last modified: February 25, 2014

var errorObj = asyncResult.error;

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 Online, Word 2013, Word 2013 SP1, Outlook 2013, Outlook 2013 SP1, Outlook Web App, OWA for Devices, PowerPoint 2013, PowerPoint 2013 SP1, Project 2013, and Project 2013 SP1

Library

Office.js

Namespace

Office

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.