Hi,
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);
document.AppendChild(importedSection);
foreach (var node in document.Sections)
{
var sect = (Section)node;
sect.PageSetup.RestartPageNumbering = true;
}
document.UpdateFields();
document.UpdatePageLayout();
document.Save(@"Test.docx");
Test.docx (25.6 KB)
Header.docx (19.7 KB)
Thanks,
Monika