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
[email protected]
Word MVP site: http://www.word.mvps.org
 
Top