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.
https://docs.aspose.com/words/net/working-with-table-of-contents/
https://reference.aspose.com/words/net/aspose.words/documentbuilder/inserttableofcontents/
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");
  1. 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.