A family of Microsoft word processing software products for creating web, email, and print documents.
See: Combine Multiple Word Documents (msofficeforums.com)
Most of the work is already done for you. Do note that adding a filename field to the source document headers is futile, as the fields will all update to the name of the destination document. The only way around that would be to insert the filenames as text, not as fields - or convert the fields to text before the documents are combined.
It is not apparent what you mean by Create a table of contents to the combined document, with each document as a table index.
A standard Table of Contents is created via a TOC field - which usually points to content created using Word's Heading Styles. If you insert a TOC field and your source documents use Heading Styles, you'll get a Table of Contents with each heading listed in the order that it appears in the combined document and each entry will link to the corresponding heading in the document body.
Indexes are entirely different, listing topics in alphabetic order and they don't have active links to the indexed content in the document body.