Compare DOC Files in C# .NET

.NET documents comparison API to detect the changes between two versions of DOC files and export to a final document with a detailed summary of the differences between the compared documents.


Download Free Trial

About GroupDocs.Comparison for .NET API

GroupDocs.Comparison for .NET is a native .NET API for comparing multiple images and documents of the same format. It helps you detect the differences within paragraphs, words, characters, shapes, even the text styles of the compared documents, merge the changes and export to a final document. It supports comparing and merging PDF, Word documents, Excel spreadsheets, PowerPoint presentations, Visio diagrams, Outlook emails, HTML, drawings and image file formats without using any external library.

Steps for Comparing DOC Files in C#

GroupDocs.Comparison makes it easy for .NET developers to compare & merge multiple DOC files in their applications by implementing a few easy steps.

  • Instantiate Comparer object with source document path or stream.
  • Call Add method and specify target document path or stream. Repeat this step for every target document.
  • Call Compare method.

System Requirements

GroupDocs.Comparison for .NET APIs are supported on all major platforms and operating systems. Before executing the code below, please make sure that you have the following prerequisites installed on your system.

  • Operating Systems: Microsoft Windows, Linux, MacOS
  • Development Environments: Microsoft Visual Studio, Xamarin, MonoDevelop
  • Frameworks: .NET Framework, .NET Standard, .NET Core, Mono
  • Get the latest version of GroupDocs.Comparison for .NET downloaded from NuGet

// Compare multiple documents from local disk

using (Comparer comparer = new Comparer("source.doc")
{
	comparer.Add("target1.doc");
    comparer.Add("target2.doc");
    comparer.Add("target3.doc");
    comparer.Compare("result.doc"); // Create result file with the specified name
}

// Compare multiple documents from stream

using (Comparer comparer = new Comparer(File.OpenRead("source.doc"))
{
	comparer.Add(File.OpenRead("target1.doc"));
    comparer.Add(File.OpenRead("target2.doc"));
    comparer.Add(File.OpenRead("target3.doc"));
    comparer.Compare(File.Create("result.doc")); // Create result file with the specified name
}

Result of Comparing Files

  • Elements that were inserted in the first file. – blue, by default
  • Elements wich were deleted from the first file – red, by default

Result of Comparing Files

Live Demos of Comparing DOC Files

Detect differences between DOC files right now by visiting GroupDocs.Comparison Live Demos website.
The live demo has the following benefits

No need to download API

No need to write any code

Just upload the source file

Get download link to save the file

About DOC File Format

Files with .doc extension represent documents generated by Microsoft Word or other word processing documents in binary file format. The extension was initially used for plain text documentation on several different operating systems. It can contain several different types of data such as images, formatted as well as plain text, graphs, charts, embedded objects, links, pages, page formatting, print settings and a lot others. The format was popular for all sorts of documentation due to the variety of options it offers to users for writing manuals, proposals, specifications, resumes, articles or any similar documents. The updated version of DOC is DOCX which is based on Office OpenXML whose specifications are openly available.

Read More About DOC File Format

Comparing Other File Formats

Multi format documents and images comparison API for .NET. Analyse the differences between documents of the same format without using any external tool.

Compare PDF Files

(Adobe Portable Document Format)

Compare DOCM Files

(Microsoft Word Macro-Enabled Document)

Compare DOCX Files

(Microsoft Word Open XML Document)

Compare DOT Files

(Microsoft Word Document Template)

Compare DOTM Files

(Microsoft Word Macro-Enabled Template)

Compare DOTX Files

(Word Open XML Document Template)

Compare RTF Files

(Rich Text File Format)

Compare TXT Files

(Plain Text File Format)

Compare XLS Files

(Microsoft Excel Binary File Format)

Compare XLSX Files

(Microsoft Excel Open XML Spreadsheet)

Compare XLTM Files

(Microsoft Excel macro-enabled template)

Compare XLSM Files

(Microsoft Excel Macro-Enabled Spreadsheet)

Compare XLSB Files

(Microsoft Excel Binary Spreadsheet File)

Compare CSV Files

(Comma Separated Values File)

Compare PPT Files

(PowerPoint Presentation)

Compare PPS Files

(Microsoft PowerPoint Slide Show)

Compare PPTX Files

(PowerPoint Open XML Presentation)

Compare PPSX Files

(PowerPoint Open XML Slide Show)

Compare POT Files

(Microsoft PowerPoint template)

Compare POTX Files

(Microsoft PowerPoint Open XML Template)

Compare ODS Files

(Open Document Spreadsheet)

Compare ODP Files

(OpenDocument Presentation File Format)

Compare OTP Files

(Origin Graph Template)

Compare ODT Files

(Open Document Text)

Compare OTT Files

(Open Document Template)

Compare VST Files

(Microsoft Visio 2003-2010 XML Drawing)

Compare JPEG Files

(JPEG Image)

Compare PNG Files

(Portable Network Graphic)

Compare GIF Files

(Graphical Interchange Format File)

Compare BMP Files

(Bitmap File Format)

Compare HTML Files

(Hyper Text Markup Language)

Compare MHTML Files

(MIME Encapsulation of Aggregate HTML)

Compare MSG Files

(Microsoft Outlook E-mail Message)

Compare EML Files

(E-mail Message)

Compare EMLX Files

(Apple Mail E-mail File)

Compare ONE Files

(Microsoft OneNote)

Compare VSD Files

(Microsoft Visio 2003-2010 Drawing)

Compare VSDX Files

(Microsoft Visio Drawing)

Compare VSS Files

(Microsoft Visio 2003-2010 Stencil)

Compare VST Files

(Microsoft Visio 2003-2010 Template)

Compare VDX Files

(Microsoft Visio 2003-2010 XML Drawing)

Compare CS Files

(CSharp Language)

Compare Java Files

(Java Language)

Compare CPP Files

(C++ Language)

Compare JS Files

(JavaScript Language)

Compare PY Files

(Python Language)

Compare RB Files

(Ruby Language)

Back to top
 English