如何以编程方式使用 Word 的“比较和合并文档...” C# 的功能?
问题
是否可以调用Word 2003的工具>比较和合并文档...”来自 C# 的函数,并获取是否发现任何差异的反馈?
到目前为止我发现了什么
可以调用这样的功能。但我不这样做不知道如何获得反馈是否发现任何差异。
private void CompareAndMergeWithFileB(string fullFilePath)
{
string FileName = fullFilePath;
object MergeTarget = WdMergeTarget.wdMergeTargetSelected;
object DetectFormatChanges = false;
object UseFormattingFrom = WdUseFormattingFrom.wdFormattingFromPrompt;
object AddToRecentFiles = true;
word.ActiveDocument.Merge(FileName, MergeTarget, DetectFormatChanges, UseFormattingFrom, AddToRecentFiles);
}
Question
Is it possible to call Word 2003's Tools > Compare and Merge Documents..." function from C# and to get feedback whether any differences were found or not?
What I have found so far
It is possible to call the functionality like this. But I don't know how to get feedback whether the were any differences found.
private void CompareAndMergeWithFileB(string fullFilePath)
{
string FileName = fullFilePath;
object MergeTarget = WdMergeTarget.wdMergeTargetSelected;
object DetectFormatChanges = false;
object UseFormattingFrom = WdUseFormattingFrom.wdFormattingFromPrompt;
object AddToRecentFiles = true;
word.ActiveDocument.Merge(FileName, MergeTarget, DetectFormatChanges, UseFormattingFrom, AddToRecentFiles);
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
绝对地。合并完成后,使用修订集合 提取有关任何更改的详细信息。
Absolutely. Once the merge is complete, work with the Revisions collection to extract details about any changes.