In macOS for the outlook add-in If there are bullet points in the e-mail body like below,
- The first bullet point.
- The second bullet point.
when I get the HTML with the below method/code.
Office.context.mailbox.item.body.getAsync(Office.CoercionType.Html, function (asyncResult) {
if (asyncResult.status === Office.AsyncResultStatus.Succeeded) {
const html = asyncResult.value;
})
It returns the html and in that, the bullet points are in the below format.
<p class=MsoListParagraph style='text-indent:0cm'><span lang=EN-US>The first
bullet point.</span></p>
<p class=MsoListParagraph style='text-indent:0cm'><span lang=EN-US>The second
bullet point.</span></p>
But when I set back the same html using the setAsync() method the bullet points are automatically removed from the e-mail body.
After setting back the html in e-mail body the bullet points aren't visible.
In windows it worked fine as the Html returned by getAsync() is different it contains the
I tried by manipulating the html and changing the tag with
Basically I tried to convert the HTML got in mac outlook add-in similar to the HTML we get from windows outlook. but I was unable to preserve their styles and CSS.
What I am Expecting: -
When I set back the html it should preserve the style, css and type of the bullet point so that the bullet is not removed from e-mail body and also be on the same position where user created it.
It is not clear what Outlook version you use on the MacOS - whether it is a web browser or the Outlook application (new UI?).
Try calling the
saveAsyncprior to getting the message body content. If that doesn't help I'd suggest posting this as an issue to theOfficeJSrepo at https://github.com/OfficeDev/office-js .I am not sure whether it is related to your problem or not, but you may may find the Outlook Addin API body.getAsync missing some styles on mac page a similar issue when dealing with a message body was filed.