CountPages

J

Jay Freedman

One way is ActiveDocument.Range.Information(wdActiveEndPageNumber).

Another way is

Sub foo()
Dim dlg As Dialog
ActiveDocument.Repaginate
Set dlg = Dialogs(wdDialogToolsWordCount)
dlg.Execute
Debug.Print dlg.Pages
Set dlg = Nothing
End Sub

There are probably others.

--
Regards,
Jay Freedman
Microsoft Word MVP
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.
 
J

Jonathan West

Ram said:
Hi,
This is not what I want. I want the code using "WordBasic".

In WordBasic, SelInfo(4) returns the number of pages in the document.

You might need to use the ToolsRepaginate command first to ensure that the
value returned is up-to-date

--
Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup
Keep your VBA code safe, sign the ClassicVB petition www.classicvb.org
 

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