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.
|