Closed harshitgoyal1711 closed 3 weeks ago
Hey @harshitgoyal1711!
It is not expected for the Html structure to be the same when body is retrieved. Please refer to the public docs for body.getAsync for more context.
For reference:
This issue has been automatically marked as stale because it is marked as needing author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment. Thank you for your interest in Office Add-ins!
This issue has been closed due to inactivity. Please comment if you still need assistance and we'll re-open the issue.
Description: We are encountering an intermittent issue with
Office.context.mailbox.item.body.getAsync
when retrieving email body content after composing a new email with a long text input (e.g., 99,999 characters). Instead of maintaining the original<div>
structure, the content is sometimes unexpectedly wrapped inside a<span>
element. However, in some cases, it works fine and retains the expected<div>
structure.Steps to Reproduce:
<div>
elements.getAsync
to retrieve the email body:Office.context.mailbox.item.body.getAsync(Office.CoercionType.Html, (result) => {
console.log(result.value);
});
Actual Output (In Modern Browsers) (Mostly Happens):
<span style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis
parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem...
</span>
Expected Output (Sometimes Works Fine as Expected):
The original
<div>
structure should be retained:<div style="color: black;">
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor...</p>
</div>
Environment Details: Browser: Chrome, Edge, Safari (Modern Browsers) Platform: Outlook Web Add-in
Observations: This issue only occurs in browsers and not in desktop Outlook. The
<div>
structure is maintained for smaller email bodies. For very long email content (99,999 characters),<div>
elements are sometimes replaced with<span>
, but other times they are retained correctly.Request for Support:
<div>
elements are retained when using getAsync?Looking forward to your response.