Docx document comparison is failing when any one / both documents have track changes enabled and contains few changes which are not accepeted / rejected.
version : com.groupdocs:groupdocs-comparison:jar:24.7
Please suggest the solution.
Docx document comparison is failing when any one / both documents have track changes enabled and contains few changes which are not accepeted / rejected.
version : com.groupdocs:groupdocs-comparison:jar:24.7
Please suggest the solution.
When comparing DOCX documents that have track changes enabled, it’s important to ensure that the comparison settings are configured correctly to handle these changes. The GroupDocs.Comparison library provides an option to utilize the Microsoft Word “Track Changes” feature during document comparisons.
To enable this feature, you can set the WordTrackChanges
property to true
in the CompareOptions
when performing the comparison. Here’s a sample code snippet demonstrating how to do this:
using System;
using System.IO;
using GroupDocs.Comparison;
using GroupDocs.Comparison.Options;
class Program
{
static void Main()
{
string sourceFilePath = "path/to/source/document.docx";
string targetFilePath = "path/to/target/document.docx";
string outputFilePath = "path/to/output/document.docx";
using (Comparer comparer = new Comparer(sourceFilePath))
{
comparer.Add(targetFilePath);
CompareOptions compareOptions = new CompareOptions()
{
WordTrackChanges = true // Enable track changes comparison
};
comparer.Compare(File.Create(outputFilePath), compareOptions);
}
Console.WriteLine("Documents compared successfully. Check output at " + outputFilePath);
}
}
Make sure to replace the file paths with the actual paths of your documents. This code will compare the two documents while considering any track changes that have not been accepted or rejected.
If you continue to experience issues with the comparison failing, ensure that both documents are properly formatted and that the GroupDocs.Comparison library is up to date. You may also want to check for any specific limitations or known issues related to the version you are using.
For further assistance, consider checking the documentation or community forums for similar issues and solutions.