public override VisitorAction VisitDocumentEnd(Document doc)
{
// All sections have separate headers and footers now, update the fields in all headers and footers
// To the correct values. This allows each page to maintain the correct field results even when
// PAGE or IF fields are used.
doc.UpdateFields();
foreach (HeaderFooter headerFooter in doc.GetChildNodes(NodeType.HeaderFooter, true))
{
foreach (Field field in headerFooter.Range.Fields)
field.IsLocked = true;
}
return VisitorAction.Continue;
}