none
Mail App compose mode - Unable to get email body content in outlook desktop client RRS feed

  • Question

  • I am unable to get body content in compose mode when i run my mail app in outlook desktop client. But, I am able to get body content when i access my app in outlook web either in IE or Chrome or FF browsers. Can anybody help me what could be the issue here? Kindly refer to attached screen shot.

    FYI, i am using 1.1 version of Office.js and here is my code snippet to read body content.

     function getBody() {
            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(Office.MailboxEnums.BodyType.Html, function (result) {
            //    app.showNotification('The current body is', result.value)
            //})
        }

    Thanks,

    Niranjan

    Monday, August 17, 2015 6:29 PM

All replies

  • Hi Niranjan,

    Thanks for your post.

    I made a test with this method, and I reproduced your issue. body.getAsync seems to not exist in outlook desktop and it worked correctly under outlook web app. I assume it is related with the outlook client version, and I update my outlook to newest, but I still could not make it work. Then, I test under the VS2015 and Office 2016 Preview, and with body.getAsync, you need to pass the parameter type and function. The code below worked correctly.

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

    If this is a feature you want to include in future versions of app for Office for Office 2013, please submit a feedback to Office Development Platform Uservoice.
    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.


    Tuesday, August 18, 2015 11:08 AM
  • Thanks for your reply. As suggested, i have submitted my feedback to office development platform uservoice.
    Tuesday, August 18, 2015 1:44 PM
  • Hi Niranjan,

    Edward's response is incorrect. The method is supported in Outlook. Which version of Outlook do you have, and which URL are you loading Office.js from?

    -Andrew

    Wednesday, August 19, 2015 12:59 AM
  • Hi Andrew,

    I test with Outlook 2013 (15.0.4745.1000) and the URL is as below:

    <script src="https://appsforoffice.microsoft.com/lib/1.1/hosted/office.js" type="text/javascript"></script>

    It did not work, if I test with Outlook 2016 Preview, it worked.

    Thanks for your help to look into this issue.

    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.


    Wednesday, August 19, 2015 1:32 AM
  • Hi Andrew,

    I am using Outlook 2013 desktop client and version 1.1 of Office.js from https://appsforoffice.microsoft.com/lib/1.1/hosted/office.js.

    Thanks,

    Niranjan

    Wednesday, August 19, 2015 4:59 AM