The Syncfusion .NET Word Library (DocIO) allows users to identify the changes between two versions of a Word document as tracked changes by comparing them, without requiring Microsoft Word or interop dependencies. With precision, it programmatically highlights insertions, deletions, and formatting changes.
Here is an example of how to compare the Word documents in C# using the Syncfusion .NET Word Library (DocIO).
//Load the original Word document.
using FileStream originalDocumentStream = new FileStream("OriginalDocument.docx", FileMode.Open, FileAccess.Read);
using WordDocument originalDocument = new WordDocument(originalDocumentStream, FormatType.Docx);
//Load the revised Word document.
using FileStream revisedDocumentStream = new FileStream("RevisedDocument.docx", FileMode.Open, FileAccess.Read);
using WordDocument revisedDocument = new WordDocument(revisedDocumentStream, FormatType.Docx);
//Compare the original and revised Word documents.
originalDocument.Compare(revisedDocument);
//Save the Word document.
using FileStream outputDocumentStream = new FileStream("Result.docx", FileMode.Create, FileAccess.ReadWrite);
originalDocument.Save(outputDocumentStream, FormatType.Docx);
Specify the author’s name and the date for revisions, simplifying the identification of changes during the comparison of Word documents.
Users can focus solely on content changes by ignoring formatting differences.
Greatness—it’s one thing to say you have it, but it means more when others recognize it. Syncfusion is proud to hold the following industry awards.