\addtocontents

\addtocontents{file}{text}

The \addtocontents command adds text (or formatting commands) directly to the file that generates the table of contents or list of figures or tables.