Generating TOF (Table Of Figures) in a Word Document

Hi,
Using ASPOSE. Words how do we generate TOF (Table Of Figures) in a Word Document. Is there any API available?
Please advice.
Thanks&Regards,
Suguna

Hi

Thanks for your inquiry.
You can insert fields in Word document using Documentbuilder.InsertField method. Please see the following link for more information:
https://reference.aspose.com/words/net/aspose.words/documentbuilder/insertfield/
For example to insert TOF you can use the following code:

// Insert Table of Figures
builder.InsertField("TOC \\h \\z \\c \"Picture\"", null);

Or the following code to insert TOC:

// Insert Table of Contents
builder.InsertField("TOC \\o \"1-3\" \\h \\z \\u", null);

Unfortunately, at the moment you should update these fields manually in MS Word to see correct values. However, there is also good news for you, We are going to support evaluation of TOC fields before the next release. Please see the following link for more information:
https://docs.aspose.com/words/net/update-fields/
Best regards.

Thanks a lot for the response. Will try it.