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

Free Support Forum - aspose.com

InsertTableOfContents with my own style

I have my own styles defined (kop1, kop2, kop3,…)
How do I telle InsertTableOfContents wich styles to take to generate de Table of contents TOC?

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

Thanks for your inquiry. I think that you don’t need to create new styles. I think that you should just edit existing styles (Heading1, Heading2, Heading3 etc). For example see the following code:

doc.Styles[StyleIdentifier.Heading1].Font.Name = "Arial";

doc.Styles[StyleIdentifier.Heading1].Font.Size = 36;

doc.Styles[StyleIdentifier.Heading1].Font.Bold = true;

doc.Styles[StyleIdentifier.Heading1].Font.Italic = true;

Hope this helps.

Best regards.

indeed,
this gives the same effect