Compares two documents and returns a Document object that represents the document that contains the differences between the two documents, marked using tracked changes.
CompareDocuments (OriginalDocument, RevisedDocument, Destination, Granularity, CompareFormatting, CompareCaseChanges, CompareWhitespace, CompareTables, CompareHeaders, CompareFootnotes, CompareTextboxes, CompareFields, CompareComments, CompareMoves, RevisedAuthor, IgnoreAllComparisonWarnings)
Dim docCompareDocuments As Document Set docCompareDocuments = Application.CompareDocuments(OriginalDocument:=, RevisedDocument:=)
The following arguments are required:
The following arguments are optional
Destination (WdCompareDestination) - Specifies whether to create a new file or whether to mark the differences between the two documents in the original document or in the revised document. Default value is wdCompareDestinationNew.
Possible Values are wdCompareDestinationNew - Creates a new file and tracks the differences between the original document and the revised document using tracked changes, wdCompareDestinationOriginal - Tracks the differences between the two files using tracked changes in the original document, wdCompareDestinationRevised - Tracks the differences between the two files using tracked changes in the revised document.
Possible Values are wdGranularityCharLevel - Tracks character-level changes, wdGranularityWordLevel - Tracks word-level changes.