To extract Table of contents from Microsoft Office Word document getToc method is used. Table of contents is generated by paragraphs with H1-H9 build-in styles.
Warning getToc method returns null value if Table of contents extraction isn’t supported for the document. For example, Table of contents extraction isn’t supported for TXT files. Therefore, for TXT file getToc method returns null. If Microsoft Office Word document has no Table of contents, getToc method returns an empty collection....Office Word documents / Extract table of contents from Microsoft Office...Office Word documents Extract table of contents from Microsoft Office...