Note

Access to this page requires authorization. You can try signing in or .

Access to this page requires authorization. You can try .

Word.CompareTarget enum

Package:
word

Specifies the target document for displaying document comparison differences.

Remarks

API set: WordApiDesktop 1.1

Used by

Examples

// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/word/50-document/compare-documents.yaml

// Compares the current document with a specified external document.
await Word.run(async (context) => {
 // Absolute path of an online or local document.
 const filePath = (document.getElementById("filePath") as HTMLInputElement).value;
 // Options that configure the compare operation.
 const options: Word.DocumentCompareOptions = {
 compareTarget: Word.CompareTarget.compareTargetCurrent,
 detectFormatChanges: false
 // Other options you choose...
 };
 context.document.compare(filePath, options);

 await context.sync();

 console.log("Differences shown in the current document.");
});

Fields

compareTargetCurrent = "CompareTargetCurrent"

Places comparison differences in the current document.

compareTargetNew = "CompareTargetNew"

Places comparison differences in a new document.

compareTargetSelected = "CompareTargetSelected"

Places comparison differences in the target document.


Feedback

Was this page helpful?