1 out of 1 rated this helpful - Rate this topic

Release notes for apps for Office

apps for Office

Published: February 26, 2013

Conceptual overview topic

This topic lists the known issues for developing an app for Office in the current build.

Applies to:  apps for Office | Office 2013 | Office 365 | Excel Web App | Exchange 2013 | Outlook 2013 | Outlook Web App | Project Professional 2013 | Word 2013 | Excel 2013 | PowerPoint 2013 

In this article
General known issues
Issues for specific app types
Changes to API members
Additional resources

The following issues apply to developing apps for Office in general, unless otherwise stated.

  • Accessing the Office Store

    The Office Store is available only for the EN-US locale in the Office 2013 release. Customers using other locales should use the EN-US version of the Office Store during this period. Visit the Office Store at http://office.microsoft.com/store.

    For more information about submitting an app for Office to the Seller Dashboard in the Office Store, see How to: Create or edit your seller account in the Microsoft Seller Dashboard.

  • Order of attributes for the Override element in a manifest

    If you use the optional Override element in a manifest, because of an XML parser error, you must specify the Locale attribute before the Value attribute.

Icon for mail apps for Office

Parity between Outlook clients

One of the design pillars for apps for Office is write-once. The same calls from your mail app to the JavaScript API for Office should work seamlessly and transparently for all Outlook clients: the Outlook rich client and Outlook Web App. The following list describes the features and APIs that do not currently support write-once and may work differently than documented:

  • Attachment support in mail apps

    Mail apps can now send a web service an authentication token and attachment identifier to enable the web service to retrieve the attachment from the Exchange server. The following object and members now support attachments in mail apps:

    Note Note

    Currently, the attachments API and callback tokens are available to mail apps that run on Outlook Web App, but not on the Outlook rich client.

  • Message.conversationId returns different values in Outlook and Outlook Web App

    In the Outlook rich client, the conversationId property of a Message object returns the value of the MAPI property PidTagConversationId. In Outlook Web App, the conversationId property returns the Exchange Web Services conversation ID. Take note if your scenario requires this property, for example passing the Exchange Web Services conversation ID to call an Exchange Web Service.

    For more information about the Exchange Web Services conversation ID, see the following:

    • As a member of the Exchange Web Services managed API: Id()

    • As an Exchange Web Services XML element: ConversationId

Icon for task pane apps

Adding a binding to a named content control in Word may fail

In Word, if there are content controls in both the main document and a subdocument (for example, textbox, header, footer), or in multiple subdocuments, attempting to use the Bindings.addFromNamedItemAsync method to bind to another control in that document may fail as if there was a name collision.

Reading table data as a "text" coercion type may return unexpected characters past the null terminator

In Word, if you use the Document.getSelectedDataAsync method to read the selected data from a table and specify the "text" coercion type, you should ignore the characters after the null-terminator in the returned data, if it's present.

Partial writing to a table may fail

If you are doing partial writing to tables, don’t include header data to get the best results. Because of a known issue, partial writing by calling the Binding.setDataAsync method with the "table" coercion type may fail if the operation includes the last row of the table. To work around this, specify null for the header array in the TableData object that is passed to the data parameter in the setDataAsync method call.

Writing to a table may fail

If you are doing full writing to tables, include header data to get the best results. Because of a known issue, partial reading using the Binding.getDataAsync method or writing by calling the Binding.setDataAsync method with the "table" coercion type may not set all the rows of the table correctly if the header row is null. To work around this, specify data for the header array in the TableData object that is passed as an argument to the setDataAsync method.

Events for custom XML parts may not fire reliably in Word

In Word, changes to a custom XML node (such as deleting, adding, or replacing a node) does not always fire the corresponding nodeDeleted, nodeInserted, or nodeReplaced event. There will be a fix shortly after Office 2013 is available to the general public. Meanwhile, instead of using the events for a custom XML node, consider using the bindingSelectionChanged and bindingDataChanged events if binding to a content control is relevant to your scenario.

For example, if you are creating a custom template where there is a repeating section content control for which you would like to listen events, you can select that content, insert a rich text content control to embed the content in that control. Using the Word user interface, assign a name to the Title property of the rich text content control. Then use the addFromNamedItemAsync method of the Bindings object to add a binding to the rich text content control using that name. With a binding in place, you can now use the bindingSelectionChanged or bindingDataChanged event to determine if you should check for changes in the custom XML part that the repeating content control is bound to.

Because the bindingSelectionChanged and bindingDataChanged events cannot provide any context information about which custom XML part changed, you’ll need to manually track the state to determine changes. Also keep in mind that dependence on nested content controls is not as reliable because users can change the structure of their document.

The JavaScript API for Office (office.js) has the following changes since the last release of Office 2013.

Important note Important

The Document.getFileAsync method, the associated File and Slice objects, and task pane apps in PowerPoint 2013 are not supported in the Office 2013 Preview release. To use these features, you must be running the final release of Office 2013 (version 15.0.4420.1017 or later).

Document.getAllContentAsync method has been removed

The Document.getAllContentAsync method has been removed in the release to manufacturing (RTM) release of Office 2013 (version 15.0.4420.1017) or later. The functionality of the getAllContentAsync method has been replaced by the new Document.getFileAsync method and the associated File and Slice objects, which are described in the "New API members" section later in this topic.

You should convert any existing apps that use the getAllContentAsync method to use the new getFileAsync method as described in the "Converting code from getAllContentAsync to getFileAsync" section following this section. For additional information about using the getFileAsync method, see How to: Get the whole document from an app for PowerPoint

Converting code from getAllContentAsync to getFileAsync

The following examples show how to convert script that currently uses the getAllContentAsync method to use the new getAllFileAsync method.

Converting script that gets document content in base64 format

The following examples show how to convert script that uses the deprecated getAllContentAsync method to return document content in base64 format. The new getFileAsync method returns the document file data as a byte array. The getFileContentTheNewWay() function uses the OSF.OUtil.encodeBase64(input) function, which is implemented in the Office.js library, to transform the returned byte array to a base64-encoded string.

Before

// Gets the document content in base64, works in Word.
function getFileContentTheOldWay() {
    var fileContent;
    Office.context.document.getAllContentAsync("base64", function (result) {
        if (result.status == "succeeded")
            fileContent = result.value;
    });
}

After

// Gets the document content in base64, works in Word and PowerPoint.
function getFileContentTheNewWay(){
    var fileContent;
    Office.context.document.getFileAsync ("compressed", function (result) {
        var myFile = result.value;
        myFile.getSliceAsync(0, function (result) {
            if (result.status == "succeeded")
                fileContent = OSF.OUtil.encodeBase64(result.value.data);
        });
    });
}

Converting script that gets document content in text format

The following examples show how to convert script that uses the deprecated getAllContentAsync method to return document content in text format.

Before

// Gets the document content in text, works in Word 
function getFileContentTheOldWay() {
    var fileContent;
    Office.context.document.getAllContentAsync("text", function (result) {
        if (result.status == "succeeded")
            fileContent = result.value;
    });
}

After

// Gets the document content in text, works in Word 
function getFileContentTheNewWay(){
    var fileContent;
    Office.context.document.getFileAsync ("text", function (result) {
        var myFile = result.value;
        myFile.getSliceAsync(0, function (result) {
            if (result.status == "succeeded")
                fileContent = result.value.data;
        });
    });
}

What version of Office.js should you use for the getAllContentAsync or getFileAsync methods?

No version of the Office.js library supports both the getAllContentAsync and getFileAsync methods. If you are using Office 2013 Preview release, you should use the getAllContentAsync method and the Office.js library that supports that method. If you are using the Office 2013 RTM release or later, you should use the getFileAsync method and the Office.js library that supports that method. As described in the following table, there are two public content delivery network (CDN) locations for distributing these two versions of the Office.js library.

Version of Office.js

CDN URL

API support

Office 2013 Preview release

https://az88874.vo.msecnd.net/api/1.0/office.js

Only supports getAllContentAsync method

Office 2013 RTM release (version 15.0.4420.1017) or later

https://appsforoffice.microsoft.com/lib/1.0/hosted/office.js

Only supports getFileAsync method

To use a CDN URL to specify the location to download Office.js from, put a script tag in the head tag of the webpage for your app as shown in the following example.

<script src="https://appsforoffice.microsoft.com/lib/1.0/hosted/office.js"/>

Eventually all apps must point to the RTM or later CDN location, which will be required when submitting an app to the Office Store. To handle how an app that uses the getFileAsync method behaves when activated in the Office 2013 Preview release of Word, you should display a message that asks the user to upgrade to the latest Office 2013 release (RTM or later). The following examples show how to write code (using the Office.js RTM release) that will run in both Office 2013 Preview and Office 2013 RTM or later releases. In Office 2013 RTM or later, the code just gets the file as expected. In Office 2013 Preview, the upgrade message is displayed. These two examples show how to get the file as base64 or as plain text format. Adjust the code as necessary to adapt to your app's design.

Getting the file as base64

function getFileAsBase64() {
     Office.context.document.getFileAsync("compressed", {}, function (result) {
        if (result.status == Office.AsyncResultStatus.Succeeded) {
            var myFile = result.value;
            myFile.getSliceAsync(0, function (result) {
                // The user is running the RTM release or later, show the file.
                document.getElementById("result").innerText = OSF.OUtil.encodeBase64(result.value.data);
            });         
        }
        else {
            try {
                // This call will throw an exception if a File Object is not returned. 
                // If so, the user is running the Preview release.
                var sliceCount= result.value.sliceCount;
            }
            catch (e) {
                // Catch the "TypeError" exception thrown when the sliceCount property does not exist.
                if (e.name == "TypeError") {
                    document.getElementById("result").innerText = "The code in this app is calling a method that is not supported in the Office 2013 Preview release, please update your Office installation to the latest release.";
                }
                else {
                    // Handle any other exceptions here.
                }
            }
        }
           
    });
}

Getting the file as plain text

function getFileAsText() {
    Office.context.document.getFileAsync("text", {}, function (result) {
        if (result.status == Office.AsyncResultStatus.Succeeded) {
            var myFile = result.value;
            myFile.getSliceAsync(0, function (result) {
                // The user is running the RTM release or later, show the file.
                document.getElementById("result").innerText = result.value.data;
            });         
        }
        else {
            try {
                // This call will throw an exception if a File Object is not returned. 
                // If so, the user is running the Preview release.
                var sliceCount= result.value.sliceCount;
            }
            catch (e) {
                // Catch the "TypeError" exception thrown when the sliceCount property does not exist.
                if (e.name == "TypeError") {
                    document.getElementById("result").innerText = "The code in this app is calling a method that is not supported in the Office 2013 Preview release, please update your Office installation to the latest release.";
                }
                else {
                    // Handle any other exceptions here.
                }
            }
        }
           
    });
}

New diagnostics object to facilitate debugging

Mail apps developers can now use the new Diagnostics object and members to help debug their mail apps and identify the host application, version of the host or Exchange Server, and type of view.

New API members

The following objects and members of the JavaScript API for Office are new in the current release of Office 2013.

Name

Description

Appointment .displayReplyAllForm method

Displays a reply form that includes the organizer and all the attendees of the selected appointment item.

Appointment.displayReplyForm method

Displays a reply form that includes only the organizer of the selected appointment item.

Document.getFileAsync method

Returns the entire document file in slices of up to 4MB.

Diagnostics object

Provides troubleshooting capabilities for a mail app.

Diagnostics.hostName property

Gets a string that represents the name of the host application.

Diagnostics.hostVersion property

Gets a string that represents the version of either the host application or the Exchange Server.

Diagnostics.OWAView property

Gets a string that represents the current view of Outlook Web App.

File object

Represents the document file associated with an app for Office.

File.size property

Gets the document file size in bytes.

File.sliceCount property

Gets the number of slices into which the file is divided.

File.closeAsync method

Closes the document file.

File.getSliceAsync method

Returns the specified slice.

Message.displayReplyAllForm method

Displays a reply form that includes the sender and all the recipients of the selected message.

Message.displayReplyForm method

Displays a reply form that includes only the sender of the selected message.

Slice object

Gets the raw data of the file slice.

Slice.data property

Represents a slice of a document file.

Slice.index property

Gets the index of the file slice.

Slice.size property

Gets the size of the slice in bytes.

Did you find this helpful?
(1500 characters remaining)

Community Additions

ADD
© 2013 Microsoft. All rights reserved.