Page n of N with InsertField NUMPAGES does not work

I have a multi section document and in footer of each section I want to show a page number along with Page n of N. The code used is as below, the output pdf document all I get is - ( 1 Page 1 of ) . Though I get correct page numbers for each section of the document total page count is missing.
If I evaluate total page count using string sCnt = doc.PageCount.ToString() and plug in using builder.Write (sCnt) still nothing shows. Intrestingly sCnt shows total sections in the document but just refuses to render. Also tried using builder.InsertField(“SECTIONPAGES”, “”). Please advise.

DocumentBuilder builder = new DocumentBuilder(doc);
foreach(Aspose.Words.Section sect in doc.Sections)
{
    builder.MoveToSection(doc.Sections.IndexOf(sect));
    builder.MoveToHeaderFooter(Aspose.Words.HeaderFooterType.FooterPrimary);
    builder.InsertField("PAGE", "");
    builder.InsertCell();
    builder.Write("Page ");
    builder.InsertField("PAGE", "");
    builder.Write(" of ");
    builder.InsertField("NUMPAGES", "");
}

Hi

Thanks for your request. Could you please attach your document for testing? I will try to reproduce the problem and provide you more information.
Which version of Aspose.Words do you use?
Best regards.