This answer is several years old and while the code still works I was wondering if there was any update from the community or Wolfram. The online references still point to AuthorTools which seems to be deprecated(?).
Generating a ToC is a must have for me document wise - it's weird that it's not on the 'insert' menu.