page number

F

fedum

I would like to read the page number of a word document
with a vba program. Can you help?
Thanks,
Marc
 
D

Doug Robbins - Word MVP

Hi Fedum,

Check out the .Information function.

Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested. Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.

Hope this helps
Doug Robbins - Word MVP
 
D

DeeJee

Check out the .Information function.

I think you can only retrieve the total number of pages in a document with
the information funtion because there is only "wdNumberOfPagesInDocument".
But how to know the active pagenumber of a document with VBA?
 
H

Helmut Weber

Hi,
MsgBox Selection.Information(wdActiveEndPageNumber)
gives you the page number of the end of the selection.
Greetings from Bavaria, Germany
Helmut Weber
"red.sys" & chr$(64) & "t-online.de"
Word 97, XP, NT4.0, W98
 
J

Jonathan West

DeeJee said:
I think you can only retrieve the total number of pages in a document with
the information funtion because there is only "wdNumberOfPagesInDocument".
But how to know the active pagenumber of a document with VBA?


Msgbox "The cursor is on page " &
Selection.Information(wdActiveEndPageNumber)


--
Regards
Jonathan West - Word MVP
MultiLinker - Automated generation of hyperlinks in Word
Conversion to PDF & HTML
http://www.multilinker.com
 
Top