You need to have your text in the body of the document formatted using the built-in heading styles or some other styles that are recognized by the TOC field.
How to create a table of contents in Microsoft Word by Shauna Kelly
It still is not going to work, though. At least I can't get it to work. Here is my attempt.
Dropbox - Example of problem.docx - Simplify your life