Compare of Variables and Document properties

View as MarkdownMarkdown

Set up your AI agent

Give your coding agent live access to the GroupDocs documentation and API reference through the GroupDocs Docs MCP server — no install, no API key. Learn more

claude mcp add --transport http groupdocs-docs https://docs.groupdocs.com/mcp

Also process documents locally

The GroupDocs.Comparison MCP server lets your agent work with files on your machine; they are never uploaded. It needs the .NET 10 SDK or Docker.

claude mcp add groupdocs-comparison -- dnx GroupDocs.Comparison.Mcp --yes
Folders, licensing and more →

On this page


GroupDocs.Comparison allows you to compare various properties of a Word document such as Variable, Built, and Custom properties.

Use the following fields of the CompareOptions class to enable comparison functions for document properties:

To activate compare document properties, follow these steps:

  1. Instantiate the Comparer object. Specify the source file path or stream.
  2. Call the Add method. Specify the target file path or stream.
  3. Instantiate the CompareOptions object. Set the CompareVariableProperty property to true for the variable properties and/or CompareDocumentProperty for built and custom properties.
  4. Call the Comparer method. Specify the CompareOptions object from the previous step.

The following code snippet shows how activate comparison of the Variable, Built and Custom properties:

using GroupDocs.Comparison;
using GroupDocs.Comparison.Options;
// ...

using (Comparer comparer = new Comparer("source.docx"))
{
    comparer.Add("target.docx");
    CompareOptions options = new CompareOptions();
    options.CompareVariableProperty = true; // to activate the comparison of variable properties
    options.CompareDocumentProperty = true; // to activate the comparison of built and custom properties

    comparer.Compare("result.docx", options);
}

The result is as follows:

On this page