0

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

  • tags for the bullet points. The issue is only with mac.

    I tried by manipulating the html and changing the tag with

  • and and adding thos
  • under the tag. it worked just to preserve the bullet point but the positions of the bullet point got changed it came at the start of line. And also it converted the numbers or other types of bullet points into round black bullet points.

    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.

  • Eugene Astafiev
    • 47,483
    • 3
    • 24
    • 45
    • Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. – Community Apr 21 '23 at 16:50
    • Please edit your question for grammar and punctuation. There are lines that are formatted as bullets that obviously weren't intended to be. Also, the paragraph begining "I tried ..." doesn't make much sense. – Rick Kirkham Apr 21 '23 at 16:55
    • My Outlook version is 2303 (Build 16227.20280). – Soham Nale Apr 24 '23 at 09:51
    • Thanks for reporting this issue. It is already in our backlog and we are actively working on the fix. We don't have a timeline to share currently but we will update the post once we have the fix. – Outlook Add-ins Team - MSFT Apr 26 '23 at 08:29

    1 Answers1

    0

    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 saveAsync prior to getting the message body content. If that doesn't help I'd suggest posting this as an issue to the OfficeJS repo 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.

    Eugene Astafiev
    • 47,483
    • 3
    • 24
    • 45