I have succesfully imported a word document with a TOC now.
Next thing to do for me is finding a way on how to add my TOC fields to the document. The purpose of this is to make a nice reports.
This is interesting. All I need to do is allow adding bookmarks and fields to the document using DocumentBuilder. This is something we wanted to do anyway so maybe we can bring this work forward. I will keep you posted.
Thanks for your effort ! I tested the insertableofcontents method. and it works fine. But for my situation it’s not much use. I load a word document with an existing TOC, and add many chapters of text. Each chapter has many paragraph styles, of which the headings are collected by the TOC. I can do this now in an awkward matter with many predifined fields. But it would be so much nicer if I were able to add a text with stylenames … from code
But I haven’t found a way to use existing styles from code.
No worries, we were going to allow specifying styles using DocumentBuilder too. It will be something like DocumentBuilder.ParagraphFormat.Style = “MyStyle”.
Do you need to be able to create styles programmatically? This can also be done, but we probably want to do this later.
This is great I will only use the styles from the template documents. And of those the most important ones are “normal” and “heading1”, “heading2”. The headings are then collected by Word to make a nice TOC.
I tested the new styles property. and it works like a charm Now I can fully comply with my clients wishes. And do it faster and easier than any other method for making Word files.
If my project proposal is agreed upon, we will choose your components.
I want to create the TOC programatically in word document using ASP.NET. Can someone has any info on this. Is any of the ASPOSE component support this.
I got to generate pocket booklet with (Table of Content)TOC . booklet layout will be 8 pages per A4 size paper.
Aspose Reporting Serivces support this feature ? If so, we are willingly to buy the product .
If you need to generate the document from an RDL report, then this product is right what you need. To insert a TOC, specify “TOC” as the textbox ToolTip property value. Note this feature is undocumented.
I want to generate Word Document from RDL .
I tested text box Tooltip as TOC .
I might miss out steps to follow.
Knowing that this feature is undocumented, could you please give me instruction steps to follow?
Style need to be “header1” ?If so, how to ?
need bookmark ?
currently if , I apply Tooltip as TOC . textbox.value can’t even visible at word doc.
Oops, I indeed forgot to mention that you have to specify the style for TOC entries as well. For the texboxes supposed to become TOC entries, set ToolTip to STYLE=“headingN” wher N is a number.
I’m not sure I understood the question. It seems like you need to update the TOC field after opening the document by pressing Ctrl-A and then F9. Then it should update page numbers being referred.