ASP NET, Xceed Docx, Table of content with heading that has no numbering

325 Views Asked by At

In my C# ASP.NET code I have:

doc.InsertTableOfContents("Table of Contents", TableOfContentsSwitches.H);  

Which results into The title of TOC is numbered

How can I insert the table of contents without the title being numbered, I ideally need something that would result intoThe title of TOC is not numbered

I tried to play around with the switches but unsucesfully, I tried to modify the Word settings when it comes to Headings or TOC but also unsucesfully

1

There are 1 best solutions below

0
Ezio2907 On

The way I did it was by using this:

doc.InsertDefaultTableOfContents();

Then I added the content to it by adding the StyleId of a HeadingX to it. For example:

paragraph.StyleId = "Heading1";