roland75
Aug 28, 2024Copper Contributor
Status:
New
[Word API] Document.compare: ability to specify Original and Revised document?
We're using the new Word.Document.compare() API, which is currently in preview (https://learn.microsoft.com/en-us/javascript/api/word/word.document?view=word-js-preview#word-word-document-compare-mem...
asparrowhawk
Jun 24, 2025Copper Contributor
Without the option to specify which document is the original, the resulting comparison can be confusing for the user. I have an example Add-in that loads some document content from a base 64 string. If I then delete a word and invoke the `compareFromBase64` function with the `CompareTarget.compareTargetNew` option a new window appears that details the differences. However the difference shown is that the word that was deleted is highlighted as being added.
The Office Add-in sample code can be found https://github.com/asparrowhawk/word-comparison