Reputation: 329
I made a test office.js Outlook add-in that injects formatted HTML into the Office.context.mailitem.body with setasync and coercion type of HTML. Everything worked but suddenly mid-January a problem appeared with editing calendar invites. The UI gets updated but when the invite is sent the text gets removed. When the calendar invite is opened from the calendar, the text is blank. Some observations:
It does not matter how simple the inserted HTML is. Inserting just the following simple HTML results in the issue:
<b>this is bold text</b>
Any ideas what could be happening?
Thanks in advance.
Upvotes: 2
Views: 473
Reputation: 155
So this is indeed a bug that will need to be fixed. In the meantime, I was playing around with this, and as a workaround, I found that if you dirty the body after you do a SetBody then the message will send correctly.
You can either do this manually by just typing a space, or in the actual call, for example:
Office.context.mailbox.item.body.setAsync
(
"<B>tim test</b>",
{
"coercionType" : "html"
},
function (asyncResult)
{
Office.context.mailbox.item.body.prependAsync(".");
}
);
(you may want to insert something less intrusive, like a space)
Upvotes: 1