correct count of pages

G

Grigoriy

Hi all,

I am create word document in maross and I put count of pages this document

Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty,
Text:="NUMPAGES", PreserveFormatting:=True

When i am print this document i obtain a incorrect quantity of the pages.

ActiveDocument.Fields.Update
For Each aField In ActiveDocument.Fields
aField.Select
Selection.Fields.Update
aField.Update
Next aField
ActiveDocument.PrintOut False
ActiveDocument.Close False
Application.Quit

As to obtain a correct count of pages of the document before print ?

Grigoriy Chelh
(e-mail address removed)
icq:118106001
 
C

Chuck Henrich

Hi Grigoriy

The simplest solution would be to make sure your update fields on print is
option is on:
Tools>Options>Print>Update fields

Or were you asking something different?

Chuck Henrich
www.ProductivityApps.com
 
C

Chuck Henrich

Hi again

You might be interested in the following article in the MS KnowledgeBase:
"WD2000: NUMPAGES Field Is Not Updated When You Open Document"
http://support.microsoft.com/default.aspx?scid=kb;en-us;270835

The article addresses Word 2000 specifically but I've tested in Word 2003
and the NUMPAGES field in headers/footers and footnotes was not updated with
..Update even if I looped through all the storyranges. However, if I ran
..Update on the all fields in all storyranges and then entered the
header/footer, the NUMPAGES field updated.

HTH
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top