I am having an issue with the TOC field and UpdateFields in version 10.6. I use builder.InsertTableOfContents(), generate a document with some headings, and call updatefields. If the able of contents is not located inside a table, everything works correctly. If it is inside a table, the page numbers do not get output. The links do point to the correct location - but the page numbers are not displayed.
In the example code below, I have a template doc with a mergefield named "toc". If the "toc" mergefield is not in a table, everything works correctly. If the "toc" mergefield is in a table, the toc page numbers are not output. Also if there is a table before the toc, it does not get updated properly.
I also tried adding a call to doc.UpdateTableLayout but that does not change anything.
// Open the template document.
AW.Document doc = new AW.Document(tocFilename);
// Create a document builder to insert content with into document.
AW.DocumentBuilder builder = new AW.DocumentBuilder(doc);
string tocswitches = "\\o \"1-4\" \\h \\z \\u";
AW.Fields.Field tocfield = builder.InsertTableOfContents(tocswitches);
(build document here - includes headers)