by jason » Tue Sep 06, 2011 10:18 am
Do you want to read the contents of the TOC field itself, or do you want to visit the numbered headings themselves?
If the latter, you could simply iterate through the paragraphs looking for those with relevant style and numPr. Start by unzipping your docx, and looking at its document.xml in a text editor.
Note that "section" has a different meaning in WordML.