We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

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

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thanks for your inquiry.

You can insert fields in Word document using Documentbuilder.InsertField method. Please see the following link for more information:

http://www.aspose.com/documentation/file-format-components/aspose.words-for-.net-and-java/aspose.words.documentbuilder.insertfield.html

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://blog.aspose.com/2009/09/13/field-update-in-aspose-words-the-killer-feature-of-2009

Best regards.

Thanks a lot for the response. Will try it.