Free Support Forum -

Compare DOCX table of contents using .NET

Hello support,

we are comparing changes in table of contents with some formatting and getting strange not user-friendly blue and red cells+tables on changed area.
Text is same, only text position is changed.

Here are files and resulting doc

Here is code:

Thank you!



Thanks you for sharing your issues with us. We reproduced this issue at our end and logged it in our issue tracking system with ID:COMPARISONNET-1539. We’re further working on it. As we have any update, we shall notify you.

Hello Group Docs,

today we got 18.4 version and we tried to test this issue using new library version.
We are still getting strange comparison markup in table of contents. Could you please double check this issue is fixed?

Please see screenshot with issue:



Using following code and v18.4.0, we cannot reproduce exact (as you shared in screenshot) output.

GroupDocs.Comparison.Comparer comparison = Common.getComparison();
var objComparisonSettings = new ComparisonSettings
         DeletedItemsStyle = new StyleSettings
                   Color = System.Drawing.Color.Red,
                   StrikeThrough = true
          GenerateSummaryPage = true,
          DetailLevel = DetailLevel.Low
ICompareResult result = comparison.Compare(Path.Combine(Common.sourcePath, Common.sourceFile), Path.Combine(Common.targetPath, Common.targetFile), objComparisonSettings);

// save result document to a file.
result.SaveDocument(Path.Combine(Common.resultPath, Common.resultFile));

However, we can see that there is still a table and we are further investigating it.
Here is the output file we generated - (16.4 KB)


We further investigated this issue and concluded the reason of strange table/cells in the output document. If you see your source document (first1.docx), it contains those Gridlines or cells. You can see those cells by following these steps:

  • Open the source document in MS Word
  • Go to layout tab
  • Enable View Gridlines
  • You will see those lines/cells in your source document

That is why you see such table or cells in your output document. See these screenshots - (166.1 KB)