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:
- Before updating fields: Test_toc.docx (32.2 KB)
- 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.