Word.CompareTarget enum
注意
此 API 以预览状态提供给开发者,可能根据我们收到的反馈更改。 请勿在生产环境中使用此 API。
指定用于显示文档比较结果差异的目标文档。
注解
示例
// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/word/99-preview-apis/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 = {
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" | 将比较结果差异置于目标文档中。 |
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈