Generation of an "index table" in Word documents

Hello,

We are using Syncfusion it to replace our old tool where we don't have the code. We want to generate Word documents automatically with the DocIO API.
We have some templates (docm) and we use Syncfusion to replace fields and data. For this, it's a very usefull tool for us. When everything will be updated we will save a lot of time.

With our template, we also want to generate an "index table" based on one field and we want to generate it with Syncfusion DocIO but I didn't found anything about it. I don't know if you support this functionnality or where to find the documentation or an example.
I found this topic on your forum where you said that it's not supported but the topic is quite old (2009) : https://www.syncfusion.com/forums/83513/word-doc-index

In the attached file, it's a picture about what we have now with our old tool for the index and what we should expect with Syncfusion (or something similar).

Is it supported by Syncfusion now?
If yes, where can I find the documentation/example?
If no, is there any tip/function to generate something similar?

Thank you in advance for your answer.

Attachment: Index_table__Syncfusion_9fa3b89e.zip

4 Replies

MR Manikandan Ravichandran Syncfusion Team April 1, 2020 06:01 PM UTC

Hi Centredoc,

Thank you for contacting Syncfusion support.

From the given details, we suspect that your requirement is about “Table of content (TOC)”. Essential DocIO have a support for creating updating the “Table of content” in the document.

Please refer our UG documentation link to know more about TOC.
https://help.syncfusion.com/file-formats/docio/working-with-table-of-contents

Please refer our demo sample for TOC:
https://ej2.syncfusion.com/aspnetmvc/DocIO/TableofContent#/material

Please let us know if you have any other questions.

Regards,
Manikandan Ravichandran
 



CE Centredoc April 2, 2020 11:40 AM UTC

Hello,


Thank you for your fast answer.

I found the documentation about the TOC but I don't think it could answer to my question. The TOC and the index table are different and not created by the same way manually (example with Word).

Maybe I missed something in the documentation but I didn't found any way to create an index on some words in the document to generate a table with these words automatically.
Are you sure that this is possible with the TOC and supported by Syncfusion with DocIO?

I'll spend more time next week and I hope to solve my problem with the TOC. I'll let you know if I find a solution before your answer.


Thank you in advanced and have a nice day.





MR Manikandan Ravichandran Syncfusion Team April 3, 2020 05:14 PM UTC

Hi Centredoc,

Thank you for you update.

From the given details, we have found that you are using Index entry fields and generate a table for their references. Currently, DocIO, doesn't support updating index entry field in the Word document.

To achieve your end requirement, we suggest you to replace index entry fields with Table entry field and append TOC to generate the contents in resultant Word document. We have prepared a sample application for the same and it can be downloaded from the below link.

Sample link: https://www.syncfusion.com/downloads/support/forum/152924/ze/AspMVC-1602195475

Input Document:
https://www.syncfusion.com/downloads/support/forum/152924/doc/index-807697077

Output Document:
https://www.syncfusion.com/downloads/support/forum/152924/doc/Result-508771516

You can find the input template Word document in "Data" folder location of above sample

In the above sample application, we have done the following things:
1.Loads an existing Word document with Index entry fields
2.Itearte into the document elements and replace Index entry fields with Table Entry fields.
3. Append Table of contents in Word document, where need to generate list of contents.
4. Enable UseTableEntryFields flag, to use Table entry fields in TOC
5. Update TOC using UpadateTableOfContents API
6. Saves the Word Document

Please let me know if you have any concern on this

Regards,
Manikandan Ravichandran




CE Centredoc April 8, 2020 06:31 AM UTC

Hello,

Sorry for the delay.

Thank you very much for your example and the support, I'm pretty sure I will find a solution to my problem with it.

Have a nice day.

Regards.

Loader.
Up arrow icon