We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

NUMPAGES in TextBox is not updated


I created document with section from other file. This section contains IF field with Textbox in result. Textbox contains NUMPAGES field. When I have only NUMPAGES field in IF field, this field is updated after document.UpdateFields(). When NUMPAGES field is in TextBox, this field is not updated.

See the sample program and the document used to replicate the bug

var document = new Document();
var template = new Document(@"Header.docx");
var importedSection = (Section)document.ImportNode(template.FirstSection, true);


foreach (var node in document.Sections)
    var sect = (Section)node;
    sect.PageSetup.RestartPageNumbering = true;



Test.docx (25.6 KB)
Header.docx (19.7 KB)

We’re using Aspose.Words for .Net v21.6.0.


We have tested the scenario and managed to reproduce the same issue at our side. For the sake of correction, we have logged this problem in our issue tracking system as WORDSNET-22459. You will be notified via this forum thread once this issue is resolved.

We apologize for your inconvenience.

The issues you have found earlier (filed as WORDSNET-22459) have been fixed in this Aspose.Words for .NET 21.9 update.