View Single Post
 
Old 08-22-2019, 02:02 PM
bedwar2 bedwar2 is offline Windows 10 Office 2016
Novice
 
Join Date: Aug 2019
Posts: 1
bedwar2 is on a distinguished road
Default ActiveDocument.TableOfContents(1).UpdatePageNumber s not working

I have a process that generates 100's of documents and creates table of contents in each one. At the end I call both .Update and .UpdatePageNumbers. I noticed that sometimes the page numbers are not correct. If I right-click and use "Update Table" and select "update page numbers only" on each document, the page number issue is corrected. However, if I try to fix by going to an Immediate Window and entering the command ActiveDocument.TablesOfContents(1).UpdatePageNumbe rs it fails to update the numbers appropriately. I am not sure why doing it through Word works, but the VBA script does not.
Reply With Quote