How to get the current page number?

A

Andrew

Hello, friends,

Probably this is a trivial question:

How to get the current page number of an open document using
Microsoft.Office.Interop.Word?

I looked up all methods/properties and could not find one that looked like.

Thanks a lot.
 
J

Jean-Guy Marcil

Andrew was telling us:
Andrew nous racontait que :
Hello, friends,

Probably this is a trivial question:

How to get the current page number of an open document using
Microsoft.Office.Interop.Word?

I looked up all methods/properties and could not find one that looked
like.

In VBA you would use the Information property:

MsgBox Selection.Information(wdActiveEndPageNumber)
MsgBox Selection.Information(wdActiveEndAdjustedPageNumber)

where the first one gives you the absolute page count in the document and
the second the page number as defined in the Page Number formatting dialog
(Insert menu > Page Numbers...)

--

Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site: http://www.word.mvps.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