InsertTableOfContents setting switches dynamically



Im using InsertTableOfContents(@"\o ““1-5"” \h \z \u”); method for inserting TOC. Now the heading levels i don’t know at development time, so can we dynamically set the heading levels by the following way -

string heading = “9”;
builder.InsertTableOfContents(@"\o “1-” + heading + “\h \z \u”); (development using c#).




Hi Kanna,

Thank you for your interest in Aspose.Word.

I think it is surely possible, the main thing is that the string being passed to the method should be formed correctly.