A family of Microsoft word processing software products for creating web, email, and print documents.
There is no built-in way to do this, and it is not a conventional TOC, which gives only the starting page for each entry, the previous chapter or section assumed to have finished before the next one starts.
If you need information on how to insert a conventional TOC, see https://shaunakelly.com/word/numbering/tableofcontents.html
You can find additional information on TOCs at http://wordfaqs.ssbarnhill.com/TOCTips.htm