Hi just wondering does anyone have the VBA code that lets you loop through all Table of Contents in a Word Document. and update them.
At the moment I am using this:
But I was wondering if there's a way to determine who many tables there are in total and loop that many times so it would work for any document.
Sometimes there's TOC, table of figures, table of table so 3 but sometimes there's only 1.
Any help is greatly appreciated.
At the moment I am using this:
VBA Code:
ActiveDocument.TablesOfContents(1).Update
ActiveDocument.TablesOfContents(2).Update
ActiveDocument.TablesOfContents(3).Update
But I was wondering if there's a way to determine who many tables there are in total and loop that many times so it would work for any document.
Sometimes there's TOC, table of figures, table of table so 3 but sometimes there's only 1.
Any help is greatly appreciated.