Incorrect table of contents (page numbers)

Hi,

We currently use v14.7 and after some googling it was suggested that the issue we are having would be solved in the latest version of aspose.words but i have just installed a trial version and the problems persists.

I am generating a new word document and the final stwp is ‘doc.UpdateFields()’ but this doesn’t work. my table of contents has pages going up to 183, but the document itself only has 159 pages!

I have tried ‘doc.UpdateTableLayout()’ and ‘doc.UpdatePageLayout()’ and neither fix the issue.

I have attached three files, a cut down version of the code, a version v14 document and a new v17 document.

You should also see that upgrading to v17 has caused other issues page’s 15 or 49 for example.

Any help would be great.

Kind regards
Jo

Hi,

Thanks for your inquiry. To ensure a timely and accurate response, please attach the following resources here for testing:

  • Your input Word document (MSNAP_Workbook.doc)
  • Please create a standalone console application (source code without compilation errors) that helps us reproduce your problem on our end and attach it here for testing.

As soon as you get these pieces of information ready, we’ll start further investigation into your issue and provide you more information. Thanks for your cooperation.

PS: To attach these resources, please zip them and Click ‘Reply’ button that will bring you to the ‘reply page’ and there at the bottom you can include any attachments with that post by clicking the ‘Add/Update’ button.

Best regards,

The two documents i attached were the MSNAP_Workbook, Sorry I should have explained.

I’m afraid its not really possible to send you a console application. We use the aspose software inside a web app.

Hi,

Thanks for your inquiry. According to MS Word 2016 there are 175 pages in your “MSNAP_Workbook v17.doc” document. The last item in TOC refers to 184th page number. The following code still calculates TOC page numbers incorrectly (see attached 17.1.0.doc).

Document doc = new Document(MyDir + @"MSNAP_Workbook+v17.doc");
doc.UpdateFields();
doc.Save(MyDir + @"17.1.0.doc");

In this document (17.1.0.doc) MS Word 2016 says there are 162 pages but last TOC item refers to 173rd page. Updating this TOC with MS Word 2016 fixes this issue. However, we have logged this issue in our bug tracking system. The ID of this issue is WORDSNET-14838. Your thread has also been linked to the appropriate issue and you will be notified as soon as it is resolved. Sorry for the inconvenience.

Best regards,

Hi,
how is it going with this issue?

We are probably facing the same problem.

Thanks,
Zdenek

@zdeseb,

Thanks for your inquiry. Unfortunately, your issue (WORDSNET-14838) is not resolved yet and there are no estimates available at the moment. Our product team has completed the initial analysis of this issue. However, because of complexity, the implementation of the fix of this issue has been postponed till a later date. We will inform you via this thread as soon as this issue is resolved. We apologize for your inconvenience.