Find Bookmark & Insert new Content | Calculate Page Numbers of Table of Content in Word Document C# .NET

Dear Aspose Team

I’m working with a document that previous was created in Microsoft Word, I have to jump to some bookmarks and write information bellow, everything works fine, but loose when I go to the last one.

If you have some idea, please let me know

Thanks in advanced

@peopleworks,

Please ZIP and attach the following resources here for testing:

  • Your simplified source Word document
  • Aspose.Words for .NET 21.4 generated output DOCX file showing the undesired behavior
  • Your expected DOCX file showing the desired output. You can create this document manually by using MS Word.
  • Please also create a standalone simple Console application (source code without compilation errors) that helps us to reproduce your current problem on our end and attach it here for testing. Please do not include Aspose.Words DLL files in it to reduce the file size.

As soon as you get these pieces of information ready, we will start investigation into your scenario and provide you code to achieve the same output by using Aspose.Words for .NET.

1 Like

Dear Aspose Team

I prepared a console sample as you suggest, but is using Aspose Word For .NET 20.6.0, because we have license for that version.

The file contains the sample project, data to fill the document in xml file and the document template. I have three bookmarks that I want to write data in, but juts the last one is the problem “BMInterfaces”. I have another problem to finish the document that is the table of contest not update the page number, it is the same sample for both, but if you prefer, I post another request.

Sample Project
https://mega.nz/folder/k5q3miba#epi3tykvzinml15ketoh-a

Note: If the problem is the version, please let me know, to tell my manager for buy the last one.

Thanks in advanced

@peopleworks,

We have logged this problem in our issue tracking system. The ID of this issue is WORDSNET-22176. We will further look into the details of this problem and will keep you updated on the status of correction. We apologize for your inconvenience.

We are also working on your bookmark related problem and will get back to you soon.

1 Like

Dear Aspose Team

Any news ?, anything you need from me just let me know.

Thanks in advanced

@peopleworks,

We have completed the analysis of this issue; but because of complexity, the implementation of the fix of this issue has been postponed till a later date. There are no estimates (ETA) available at the moment. We will inform you via this forum thread as soon as linked issue will get resolved in future. We are also working on your bookmark related problem and will get back to you soon. We apologize for your inconvenience.

1 Like

@peopleworks,

Please upgrade to the latest 21.5 version of Aspose.Words for .NET, try replacing the following line of code inside the InsertTableDirectly method of DocumentHelpers.cs

builder.CurrentSection.Body.AppendChild(table);

with

builder.CurrentParagraph.ParentNode.InsertAfter(table, builder.CurrentParagraph);
1 Like