current page number

K

Kislay

ActiveDocument.ComputeStatistics(wdStatisticPages) gives
the total number of pages in a document. The cursor is at
page 13 in a document of 16 pages. Could someone please
let me know how to know the current page number (13 in
this case).

Kislay
 
M

Mark Tangard

[posted and emailed]

Kislay:

Use:

Selection.Information (wdActiveEndPageNumber)

or if you've altered the Start At spec so that the actual
page number isn't the physical page number:

Selection.Information (wdActiveEndAdjustedPageNumber)

Note that this returns the page number of the selection's
"active end," so you probably want to collapse the selection
first if there's any chance your code will be running while
selection includes text on more than one page.
 

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