locked
Office.js version 1.3 for Outlook 2013 Desktop Client RRS feed

  • Question

  • I am creating an Outlook Mail Add-in and using the Body.getAsync().  Testing in the desktop client that api method is not available.  I get a javascript error, inspecting it shows the 1.3 api methods are not available.   I upgraded my desktop client specified by this article https://support.microsoft.com/en-us/kb/2625547.  My current desktop version is 15.0.4763.1003.  

    Originally I only specified the DefaultMinVersion as 1.1 in my manifest.xml.  So I added the MinVersion to 1.3 for the Mailbox entry.  Now the add-in doesn't show for my desktop client at all.  I am loading the manifest.xml from a file for testing.  Not sure what effect that would have, just wanted to mention it.

    Has anyone else had this problem?  If so, what steps did you take to resolve it.

    Thursday, October 22, 2015 3:56 PM

Answers

  • Hi bbCharles,

    As my research and test, it seem that getAsync method is not supported in Outlook 2013, and it is supported by Outlook 2016.

    You could not use it under Outlook 2013 client, and you could use the code below under Outlook online. You do not need to set the parameter for coercionType when you use this method in outlook online.

    function GetBodyTest() {
        //Office.cast.item.toMessageCompose(Office.context.mailbox.item).body.getAsync(function (result) {
        //    app.showNotification('The current body is', result.value)
        //});
    
        Office.context.mailbox.item.body.getAsync(function (result) {
            app.showNotification('The current body is', result.value)
        });
    }
    

    You could use the code below under Outlook 2016 client, but, you need to set the parameter for coercionType.

    function GetBodyTest() {
        Office.context.mailbox.item.body.getAsync("html",function (result) {
            app.showNotification('The current body is', result.value)
        });
    }

    This is not updated in the document, I suggest you submit a feedback in the link below:
    http://officespdev.uservoice.com

    Best Regards,

    Edward


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    • Marked as answer by bbCharles Friday, October 23, 2015 8:52 PM
    Friday, October 23, 2015 7:13 AM

All replies

  • Hi bbCharles,

    As my research and test, it seem that getAsync method is not supported in Outlook 2013, and it is supported by Outlook 2016.

    You could not use it under Outlook 2013 client, and you could use the code below under Outlook online. You do not need to set the parameter for coercionType when you use this method in outlook online.

    function GetBodyTest() {
        //Office.cast.item.toMessageCompose(Office.context.mailbox.item).body.getAsync(function (result) {
        //    app.showNotification('The current body is', result.value)
        //});
    
        Office.context.mailbox.item.body.getAsync(function (result) {
            app.showNotification('The current body is', result.value)
        });
    }
    

    You could use the code below under Outlook 2016 client, but, you need to set the parameter for coercionType.

    function GetBodyTest() {
        Office.context.mailbox.item.body.getAsync("html",function (result) {
            app.showNotification('The current body is', result.value)
        });
    }

    This is not updated in the document, I suggest you submit a feedback in the link below:
    http://officespdev.uservoice.com

    Best Regards,

    Edward


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    • Marked as answer by bbCharles Friday, October 23, 2015 8:52 PM
    Friday, October 23, 2015 7:13 AM
  • Thanks Edward.  It's tough understanding what is supported in the different environments.  Submitting feedback.
    Friday, October 23, 2015 8:52 PM