Word.DocumentCompareOptions interface
指定要包含在比较文档作中的选项。
注解
示例
// 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.");
});
属性
| add |
如果提供,则指定是否将文档添加到“ 文件 ”菜单上最近使用的文件列表。 默认值 |
| author |
如果提供,则指定与比较生成的差异关联的审阅者名称。 如果未指定,则值默认为修订文档的作者姓名,如果没有作者信息,则为字符串 |
| compare |
如果已提供,则指定用于比较的目标文档。 默认值为 |
| detect |
如果提供,则指定比较是否应包括对格式更改的检测。 默认值 |
| ignore |
如果提供,则指定是否在不通知用户出现问题的情况下比较文档。 默认值 |
| remove |
如果提供,则指定是否从返回 |
| remove |
如果提供,则指定是否从返回 |
属性详细信息
addToRecentFiles
如果提供,则指定是否将文档添加到“ 文件 ”菜单上最近使用的文件列表。 默认值 true为 。
addToRecentFiles?: boolean;
属性值
boolean
注解
authorName
如果提供,则指定与比较生成的差异关联的审阅者名称。 如果未指定,则值默认为修订文档的作者姓名,如果没有作者信息,则为字符串 Comparison 。
authorName?: string;
属性值
string
注解
compareTarget
如果已提供,则指定用于比较的目标文档。 默认值为 compareTargetCurrent。
compareTarget?: Word.CompareTarget | "CompareTargetCurrent" | "CompareTargetSelected" | "CompareTargetNew";
属性值
Word.CompareTarget | "CompareTargetCurrent" | "CompareTargetSelected" | "CompareTargetNew"
注解
detectFormatChanges
如果提供,则指定比较是否应包括对格式更改的检测。 默认值 true为 。
detectFormatChanges?: boolean;
属性值
boolean
注解
ignoreAllComparisonWarnings
如果提供,则指定是否在不通知用户出现问题的情况下比较文档。 默认值 false为 。
ignoreAllComparisonWarnings?: boolean;
属性值
boolean
注解
removeDateAndTime
如果提供,则指定是否从返回 Document 的 对象中跟踪的更改中删除日期和时间戳信息。 默认值 false为 。
removeDateAndTime?: boolean;
属性值
boolean
注解
removePersonalInformation
如果提供,则指定是否从返回 Document 的对象中的注释、修订和属性对话框中删除所有用户信息。 默认值 false为 。
removePersonalInformation?: boolean;
属性值
boolean