Updating fields breaks formatting of table of contents

Hello!

We have a document that gets its table of contents broken after fields are updated with Apose.Words.

Here are two versions of the document:

  1. Before updating fields: Test_toc.docx (32.2 KB)
  2. After updating fields: Test_toc_updatedFields.docx (25.6 KB)

The following code can be run to reproduce the issue:

const string loadPath = "insertPathToDocumentHere";
const string savePath = "insertSavePathHere";

var document = new Document(loadPath);
document.UpdateFields();
document.Save(savePath);

After updating fields the headers on level 2 are moved to where the page numbers are and continue on the row.

The example code was run in a .NET8 console app on a Windows 11 machine using Aspose.Words 24.6.

@lars.olsson
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): WORDSNET-27153

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.