In the
manage styles dialog on the Recommend tab, change the setting for the style.
Generally in an automatically generated Table of Contents neither the hyperlink nor visited hyperlink styles are used.
How to create a table of contents in Microsoft Word by Shauna Kelly