0
votes

I have recently been working with the Office JavaScript API, have managed to get some data I need using it, but am having issues with getting the body of an email. Have tried a few approaches at getting the body: 1: https://dev.office.com/reference/add-ins/outlook/1.5/Body?product=outlook&version=v1.5

2:

 Office.context.mailbox.item.body.getAsync(Office.CoercionType.Text, 
   function (result) {
       console.log("Selected data: " + result.value + result.status + result.error);
   }
    )
function write(message){
    console.log(message);
}




}

So far I have managed to get data out of emails like the subject and email address of the sender, but everytime i start doing aSync stuff - even with the code samples on Microsofts website i get the below error.

The exact error that i get is:

OSF_DDA_Error {name: "InternalFormatError", message: "There was an internal format error.", code: 9002}

Any help would be appreciated, Thanks :)

2

2 Answers

1
votes

Turned out to be me doing some document.writes in the add in via JavaScript. It turns out that these were doing something weird to the email body and screwing up the aSync request. I changed them all to console.log and it worked (after trying many other things). Hope this helps anyone who gets the same error!

0
votes

What client (desktop client, web app) are you using? Would you be able to provide us with the version of Outlook that you are using? If you are using the desktop client, this will be listed under File > Office Account.

It could be helpful to have a copy of the email whose body you are trying to get.