Click or drag to resize
ComparisonTargetType Enumeration
Allows to specify base document which will be used during comparison. Default value is Current.

Namespace: Aspose.Words
Assembly: Aspose.Words (in Aspose.Words.dll) Version: 19.9
public enum ComparisonTargetType
  Member nameValueDescription
Current0 This document is used as a base during comparison.
New1 Other document is used as a base during comparison.
Relates to Microsoft Word "Show changes in" option in "Compare Documents" dialog box.
Shows how to specify which document shall be used as a target during comparison

Document doc1 = new Document(MyDir + "Document.CompareOptions.1.docx");
Document doc2 = new Document(MyDir + "Document.CompareOptions.2.docx");

// ComparisonTargetType with IgnoreFormatting setting determines which document has to be used as formatting source for ranges of equal text.
CompareOptions compareOptions = new CompareOptions
    IgnoreFormatting = true,
    IgnoreCaseChanges = false,
    IgnoreComments = false,
    IgnoreTables = false,
    IgnoreFields = false,
    IgnoreFootnotes = false,
    IgnoreTextboxes = false,
    IgnoreHeadersAndFooters = false,
    Target = ComparisonTargetType.New
doc1.Compare(doc2, "vderyushev", DateTime.Now, compareOptions);

doc1.Save(ArtifactsDir + "Document.CompareOptions.docx");
See Also