How do a find out how many pages in a document

R

Rod

How do a find out how many pages in a document using code?

and also

How do I modify the properties (Author etc) of a document in code?


many thanks in advance

Rod
 
G

Graham Mayor

Try the following

ActiveDocument.BuiltInDocumentProperties("Author").Value = "Someone"
Selection.EndKey wdStory
iPage = Selection.Information(wdActiveEndPageNumber)
MsgBox ActiveDocument.BuiltInDocumentProperties("Author") & vbCr & iPage


--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
R

Rod

Many thanks, this works a treat.


Graham Mayor said:
Try the following

ActiveDocument.BuiltInDocumentProperties("Author").Value = "Someone"
Selection.EndKey wdStory
iPage = Selection.Information(wdActiveEndPageNumber)
MsgBox ActiveDocument.BuiltInDocumentProperties("Author") & vbCr & iPage


--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 

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