Skip to main content
All docs
V25.1
  • RichEditDocumentServerExtensions.Compare(Document, Document, ComparisonTargetType) Method

    Compares the current document with another document. Returns the document with revisions. Allows you to specify where to load the resulting document.

    Namespace: DevExpress.XtraRichEdit

    Assembly: DevExpress.Docs.v25.1.dll

    NuGet Package: DevExpress.Document.Processor

    Declaration

    public static void Compare(
        this Document originalDocument,
        Document revisedDocument,
        ComparisonTargetType targetType
    )

    Parameters

    Name Type Description
    originalDocument Document

    The original document.

    revisedDocument Document

    The document that should be compared to the original document.

    targetType ComparisonTargetType

    An enumeration value that specifies where to load the resulting document.

    Example

    The following code snippet replaces the revised document with the comparison result:

    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");
    
    wordProcessor.Document.Compare(wordProcessorRevised.Document, ComparisonTargetType.Revised);
    wordProcessorRevised.SaveDocument("comparison.docx", DocumentFormat.Docx);
    
    See Also