Free Support Forum - aspose.com

How to Generate Table of Content & List of Figures

Hi,

How to Generate Table of Content & List of Figures (Index) using Aspose Word.





Thanks & Regards

Srinivas

Hi

Thanks for your request. You can insert the TOC into the document using InsertTableOfContents method. See the following links.
http://www.aspose.com/Products/Aspose.Words/Api/InsertingaTableofContents.html
http://www.aspose.com/Products/Aspose.Words/Api/Aspose.Words.DocumentBuilder.InsertTableOfContents.html

I hope that this will help you to solve your task.

Best regards.

Thanks For the Reply.

But i want to build the TOC Dynamically by reading the Current Document and i didnot find any solution for Table of Figures.



Kindly advise.





Thanks & Regards

Srinivas





Hi

1. You can insert Table Of Figures using the following code. But you should update TOF manually in MS Word.

Document doc = new Document(@"406_105429_srinivasgoud\in.doc");

DocumentBuilder builder = new DocumentBuilder(doc);

builder.InsertTableOfContents("\\h \\z \\c \"Picture\"");

doc.Save(@"406_105429_srinivasgoud\out.doc");

2. Aspose.Words document represents content and formatting of a document, not its layout into pages. That’s why you can’t generate dynamic TOC.

Please let me know if you would like to know anything else.

Best regards.