Hi there,
I’m using Aspose.Words for .NET in version 17.10 and I stumpled on this issue concerning the page numbers in the table of contents.
The attached file was created by merging serveral word documents into each other and applying some mail merge operations.
Now, all I do is open the file, call UpdateFields() and save it.
using (var s = new MemoryStream(pathToFile))
{
var d = new Document(s);
d.UpdateFields();
d.Save("result.docx", (SaveFormat)d.OriginalLoadFormat);
}
Unfortunately, the page numbers in result.docx are not correct!
The second attached file was created by opening the first file in ms word and saving it unter a new name. If I run the same code on this file, the table of content is correct!
So, either I am making some mistake creating the document and it is missing some important parts, or there is an issue with the UpdateFields method.
Either way, I’m looking forward to reading your thoughts on this
files.zip (60.5 KB)