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

Free Support Forum - aspose.com

Page numbers are not displaying in TOC fields

Hi,

I am using latest Aspose.words 9.0 dlls and calling the below method to update TOC fields in my document. But unfortunately page numbers are not showing, insted of numbers displaying qutionsmarks (??) in document. I was using this statement to update TOC fields:

Document.UpdateFields() methods to achive this.

Is Updation of page numbers along with TOC fields update, not fixed in Aspose.words 9.0?

Thanks,

Hi Srinu,


Thanks for your request. Could you attach the document you are getting issues with?

Thanks,

Hi Srinu,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Use the following code.

Document doc = new Document(dataDir + "Test Document.doc");

doc.UpdateFields();

doc.UpdatePageLayout();

doc.Save(dataDir + "Test Document Out.doc");

When you call the Document.UpdateFields method, Aspose.Words updates (entirely rebuilds) the TOC field, but does not insert page numbers into the TOC field yet. Aspose.Words calculates correct page numbers and inserts into the TOC when the document layout is built. To do this you need to call Document.UpdatePageLayout.

If this does not solve the issue then can you attach the documents for testing as Denis suggested.

Thanks,