The macro in the link inserts the output as an INDEX at the end of the document. Although Word indexes don't use a table, they normally have a tabular layout. I've revised the code in the link to ensure that outcome.
For an idea of what building a table would entail, see:
https://www.msofficeforums.com/word/...html#post32031