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

Free Support Forum - aspose.com

Table of Contents in ASPOSE.WORDS

Hi,

I am using ASPOSE.WORDS for .NET 4.4.2.

I am struggling trying to create numbered paragraphs by cloning paragraphs from another document and adding them like this:

var clonedSubSectionParagraph = (Paragraph)subSectionParagraph.Clone(true);
clonedSubSectionParagraph.Runs[0].Text = subSection.Title;
clonedSection.Body.Paragraphs.Insert(counter, clonedSubSectionParagraph);

I am guessing there is a better way of doing this.

I am cloning from an existing template document as I don’t want to hard code the style into the document.

Also Is it possible to update the table of contents in 4.4.2?

Thanks

Paul

Hi

Thanks for your request. If you need to create List, please see the following link to learn how to achieve that.
https://docs.aspose.com/words/net/working-with-lists/
Unfortunately, Aspose.Words cannot update TOC fields, so you should update it manually in MS Word.
Best regards.