A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Word » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Incorrect {PAGE} fields in document compiled with VBA from others docs



 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old June 2nd, 2004, 07:46 AM
Ganeth
external usenet poster
 
Posts: n/a
Default Incorrect {PAGE} fields in document compiled with VBA from others docs

The situation:
Having successfully compiled (using VBA) a large document from 100+ smaller documents, I'm now faced with a page numbering problem. Although the page number in the 'status' bar at the bottom of Word gives the correct page number, a {PAGE} field inserted into the footer of each page gives an incorrect value - out of 220 pages, it reads page 1 to 82 of 220 ( Page 1 of 220, Page 2 of 220 etc), then Page 1 to 4 of 220, then Page 1 to 4 of 220, etc, until the last 'group' reads Page 1 to 58 of 220 - v. weird as these numbers do not tally up with the number of pages in the inserted files, which are mostly just two page files.

I have already tried:
1) Programmatically numbering these pages by looping through each page and writing manual values to the footers - this does not work due to the fact that the section breaks often display the same page number twice.
2) Programmatically going to each footer, deleting the incorrect values, doing an activedocument.repaginate, adding a {PAGE} field, then doing activedocument.repaginate again.

In addition to all of the above, this actually worked at one point in the past without any programmatic adjustments after generating the document from the source documents. This problem has cropped up after I tried to speed up execution by using word.application.visible = true. I removed the code for hiding the application, but the problem still remained even after this. There is unique information beside the page number in each section footer, so I can't just redo all the sections.

Any suggestions would be most welcome.

Many thanks,

Ganeth

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 10:51 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.