none
JavaScript API getAllContentAsync function is always undefined RRS feed

  • Question

  • I’m having a problem with the JavaScript API document.getAllContentAsync() function.

     I have the manifest permissions set to ReadWriteDocument in both the xml file and the form that comes up if you double click the manifest project xml file (in Solution Explorer).  The xml properties page has a dropdown, and that’s set like this:Manifest permissions

    The function to get all content is always undefined.  I can see it in the office.js source, so I am assuming it is a permissions thing.

    Here’s the code:

    function getAllDocument() {
        if (Office.context.document.getAllContentAsync) {
            Office.context.document.getAllContentAsync(
                "base64",
                function (result) {
                    if (result.status == "failed") {
                        logWrite(result.error.name + ": " + result.error.message);
                    }
                    else {
                        logWrite(result.value);
                    }
                });
        }
        else {
            logWrite("Permissions prevent accessing entire document");
        }
    }
    Thursday, August 30, 2012 11:00 PM

Answers