Forum Discussion

Dempsey9's avatar
Dempsey9
Copper Contributor
Aug 18, 2026

New Outlook Office.js Html body insert fails with error 9011 HtmlSanitizationFailure

I am building an Outlook web add-in for New Outlook on Windows. Calling mailbox.item.body.setSelectedDataAsync, prependAsync, or setAsync with CoercionType.Html fails with HtmlSanitizationFailure code 9011 on an empty HTML compose body, even for minimal Learn-style bold markup. CoercionType.Text works on the same client. Is 9011 a known New Outlook issue? Where is this error documented? What is the supported way to insert formatted HTML from an add-in?

1 Reply

  • Your add-in inserts plain text, but every Body API rejects even minimal HTML in New Outlook with error 9011. Microsoft’s Office.Body documentation supports HTML insertion when getTypeAsync reports HTML; its documented errors do not list 9011 or HtmlSanitizationFailure. This looks like a New Outlook regression or service defect, not an expected requirement to abandon HTML. Log Outlook build, Mailbox requirement-set support, body type, and complete asyncResult.error. Retest in a new message, signatures disabled, using only a small bold fragment—no full document, style block, script, SVG, or remote content. Run the same add-in against Outlook on the web and classic Outlook with the same mailbox. If only New Outlook fails, retain text coercion as a temporary fallback and submit the minimal reproduction through New Outlook feedback and Microsoft support. There is no documented alternative HTML API that guarantees bypassing the sanitizer.