开发者

How to programmatically use Word's "Compare and Merge Documents..." functionality from C#?

开发者 https://www.devze.com 2023-02-11 12:17 出处:网络
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?

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 k开发者_开发问答now 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);
    }


Absolutely. Once the merge is complete, work with the Revisions collection to extract details about any changes.

0

精彩评论

暂无评论...
验证码 换一张
取 消