Aspose.words --> Update Table of Contents

Hi,

I am loading a docx into the Document class. Then I am adding some sections and inserting some documents.

Finally, I would like to find the table of contents (this already exists) and ask it to update itself.

How can I do this last part?

Kind regards,

Paul.

Hi Paul,

You can update the TOC through code by calling these two methods below on your document.

doc.UpdateFields();

doc.UpdatePageLayout();

If you need any further help please feel free to ask.

Thanks,