Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 08-22-2019, 02:02 PM
bedwar2 bedwar2 is offline ActiveDocument.TableOfContents(1).UpdatePageNumber s not working Windows 10 ActiveDocument.TableOfContents(1).UpdatePageNumber s not working Office 2016
Novice
ActiveDocument.TableOfContents(1).UpdatePageNumber s not working
 
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
  #2  
Old 08-23-2019, 05:45 AM
Guessed's Avatar
Guessed Guessed is offline ActiveDocument.TableOfContents(1).UpdatePageNumber s not working Windows 10 ActiveDocument.TableOfContents(1).UpdatePageNumber s not working Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 3,966
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

Maybe the content needs to be paginated before the page numbers can be calculated. Are you forcing a pagination at any stage?
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
Reply

Tags
fails, table of contents, updatepagenumbers

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
OrganizerCopy method for ActiveDocument AnnaNmty Word VBA 4 07-25-2018 08:31 PM
ActiveDocument.TableOfContents(1).UpdatePageNumber s not working ActiveDocument.Words(i).Characters.Last.Text statment not working nbecklin Word VBA 3 12-08-2015 02:56 PM
ActiveDocument.ContentControls(ID) not working Tejas.T Word VBA 3 03-09-2015 06:50 PM
wordapp.ActiveDocument.SaveAs Not Working KSReynolds Mail Merge 1 07-18-2014 04:03 PM
ActiveDocument.TableOfContents(1).UpdatePageNumber s not working Using With ActiveDocument.Tables() SuzeG Word VBA 1 01-08-2014 02:00 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 10:47 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft