Using OOXML in Word 2013 task pane app RRS feed

  • Question

  • I'm looking calling the Office.context.document.setSelectedDataAsync function using the "ooxml" coercionType. Is there an example of this functionality available?

    Tuesday, September 18, 2012 11:31 AM


  • Hi stbutler,

    OOXML code samples are in the works and will be published in the future. In the meantime, if you are unfamiliar with OOXML you can check out the following sites to learn more:

    Additionally, you can inspect the OOXML representation of various data types in Word, directly through an app for Office. Try doing something like the following:

    function getData(elementId) {
        function (result) {
            if (result.status == "succeeded") {
                document.getElementById(elementId).value = result.value;

    The above function gets the selected data using coercion type OOXML, and writes the data into text element on the app HTML page. You can try inserting text, images, shapes, tables, etc. with your own custom formatting and use the above function to inspect the OOXML representation of that data. You can save that data to a variable, and write it back into the document; you should notice that using OOXML gives a full fidelity transfer of data, which is a great advantage over other coercion types! Hopefully you can give these alternatives a try for now.


    • Marked as answer by stbutler Wednesday, September 19, 2012 8:24 AM
    Tuesday, September 18, 2012 6:57 PM