Skip to main content
All docs
V25.1
  • CompareDocumentOptions Class

    Contains options used to compare two documents.

    Namespace: DevExpress.XtraRichEdit.API.Native

    Assembly: DevExpress.Docs.v25.1.dll

    NuGet Package: DevExpress.Document.Processor

    Declaration

    public class CompareDocumentOptions

    Remarks

    Pass the CompareDocumentOptions instance as a RichEditDocumentServerExtensions.Compare method parameter to specify comparison options.

    Set the required CompareDocumentOptions option to false to ignore changed document elements or formatting changes.

    Example

    The following code snippet specifies comparison settings and passes the CompareDocumentOptions instance as the Compare method parameter:

    word processing compare documents change settings

    using DevExpress.XtraRichEdit;
    using DevExpress.XtraRichEdit.API.Native;
    
    var wordProcessor = new RichEditDocumentServer();
    var wordProcessorRevised = new RichEditDocumentServer();
    wordProcessor.LoadDocument("C:\\Documents\\sample text original.docx");
    wordProcessorRevised.LoadDocument("C:\\Documents\\sample text revised.docx");
    
    CompareDocumentOptions options = new CompareDocumentOptions();
    options.CompareFormatting = false;
    options.CompareCaseChanges = false;
    options.ComparisonLevel = ComparisonLevel.Word;
    options.Author = "Nancy Doe";
    options.DateTime = DateTime.Now;
    
    Document document = wordProcessor.Document.Compare(wordProcessorRevised.Document, options);
    document.SaveDocument("comparison.docx", DocumentFormat.Docx);
    

    Inheritance

    Object
    CompareDocumentOptions
    See Also