We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Parse text from TOC


I've been trying to parse all text from Table of Contents from a document I created using MSWord only.

I know I can get the TOC by checking if any ChildEntity has EntityType == EntityType.TOC, however I can't see a way to loop through all content inside a Table of Content to get texts, as I couldn't find any inside TableOfContents class.

I need to be able to extract Texts from any TOC inside a word document, but can't find a way using syncfusion.

Could you please help me on this?

- Mauricio

1 Reply

SY Sethumanikkam Yogendran Syncfusion Team October 26, 2016 12:31 PM UTC

Hi Mauricio,

Thank you for contacting Syncfusion support.

I need to be able to extract Texts from any TOC inside a word document, but can't find a way using Syncfusion. Could you please help me on this?
Yes, you can extract Text from TOC by iterating through its elements. We have prepared a sample to meet your requirement. In this sample, we have done the following things,

1. Loaded the template Word document which has TOC inside of it.
2. Iterated TOC entries from document and found text in it.
3. Added found text in String Builder.
4. Shown the result of text in Message Box.

Please find the below sample which illustrates the same, and let us know if it helps you.

Note: Find input Word document (Template.docx) from “Data” folder inside the DocIO Application.

If we misunderstood your requirement, kindly update us requirement with clear description. Thereby we will analyze further on the mentioned requirement and update you with appropriate solution.

Please let us know if you have any other questions.


Live Chat Icon For mobile
Up arrow icon