views:

313

answers:

1

I'm using Aspose.Words to construct a Word Document programmatically (C#) on a server. The dynamically generated documents can be imported by clients via a web interface. Everything is great except I'm unable to generate a TOC. I've already exhausted my options with Aspose. Updating TOC fields is simply not a feature that Aspose currently supports. So... I'm open to any other viable solution even if it involves other third-party components. Automation has been ruled out because the Word Document is constructed on the server-side and Microsoft does not recommend using Automation on servers.

Can anyone suggest a solution? The optimal solution would be simply to be able to programmatically do a TOC Field Update. The solution cannot require installation of Word on the server. Are there any server-side reporting components that support this feature?

If a simple TOC Field Update solution is not available, then the next best thing would probably be the ability to programmatically construct a TOC by inspecting the Word document and extracting page numbers.

All ideas and input are welcome. I need a solution very soon.

Thanks,

Ed

A: 

Check this

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

BUt i can't find a way to generate it automatically without using F9 key in MS Word...

Calim
Yeah, that's the problem. Having the user have to hit F9 is not acceptable, especially if one offers other output formats like PDF. I got around the problem by adding bookmarks to each chapter I wanted to see on the TOC and then manually building a table using the bookmarks as references. it's not a perfect solution but it's OK for now. I think Aspose will add support for TOC fields in 2010.
Ed Chaparro