Skip to content

Body.getHtml() does not return all HTML classes #2898

@mkm17

Description

@mkm17

Your Environment

  • Platform [PC desktop, Mac, iOS, Office on the web]: Office on the web
  • Host [Excel, Word, PowerPoint, etc.]: Word
  • Office version number: 16.0.15810.41017
  • Operating System: Windows 11
  • Browser (if using Office on the web): Chrome

Expected behavior

Body.getHtml() should return data with classes used in web like: SpellingErrorV2Themed.

Current behavior

The function returns HTML data without all classes shown on the editor

Steps to reproduce

  1. Write text with a spelling error
  2. Inspect the editor with the browser inspector (get source 1)
  3. Invoke the Body.getHtml() function and get source 2)
  4. Compare source 1 and source 2

Context

Some time ago, I have created a test extension for the MS Word application that counts a number of incorrect words provided in the editor. Previously, an HTML class for spelling errors was returned by using the getHtml function. Two weeks ago, I noticed that the class is not returned by the function anymore.

I can see in the documentation that the function returns the formatting will be close, but not exact, so the effect presented nowadays is correct. Still, I am wondering if there is any possibility to get a similar HTML presented in the editor as it was done before.

Thank you in advance.

Metadata

Metadata

Assignees

Labels

Area: WordIssue related to Word add-insStatus: under investigationIssue is being investigatedType: product bugBug in the Office Add-ins platform or Office JavaScript APIs

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions