Highlight multiple words in Office Word without changing the text or style

Highlight multiple words in Office Word without changing the text or style
1

Upvotes

Upvote

 Feb 27 2023
2 Comments (2 New)
New

I am working on a MS Office 365 Word Add-in and currently struggling to highlight multiple words which doesn't use "highlightText" or similar Office.js API calls, since I don't want to change the content itself.

 

The highlighted areas should only be existing when analysing the text and not being saved or printed with the document. So in fact, I'm looking for a possibility to highlight words just like the built-in grammar tool.

I've already found similar requests to the same basic problem here and here.

Thank you & best regards, Thomas

Comments
Microsoft

Please see our latest Word 1.7 API. Annotation should be able to address your requirement here: Word JavaScript API requirement set 1.7 - Office Add-ins | Microsoft Learn

Copper Contributor

Just tried it out and it works great!
Thanks guys, that opens up many new possibilities for what we can do with the document text.

Some quick feedback:
If you cut out the whole document text containing annotations with CTRL + X, some minor higlighting remains behind in the document:
Unbenannt.JPG

Tested in Office 365, Word Version 2402 (Build 17328.20184).
Maybe still a minor bug on your side?

Thanks for getting back in touch with me,
Thomas