Word.CompareTarget enum
指定用于显示文档比较结果差异的目标文档。
注解
示例
// 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 = $("#filePath")
.val()
.toString();
// 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.");
});
字段
compareTargetCurrent = "CompareTargetCurrent" | Places当前文档中的比较差异。 |
compareTargetNew = "CompareTargetNew" | 将比较结果差异置于新文档中。 |
compareTargetSelected = "CompareTargetSelected" | 将比较结果差异置于目标文档中。 |