Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

current page number

Status
Not open for further replies.

choppysuey

Technical User
Mar 28, 2001
54
US
Hi all, could someone please tell me how to get the current page number that the cursor is on in a word document. Which collection of objects is this information found in??
 
Here is an example how to do it.

Code:
oWord = createobject('word.application')
odocument=oWord.Documents.Open('c:\all products') && Multiple page document.
oDocument.Repaginate  && Tout make sure the pagecount is right
DO WHILE oWord.selection.Information(3)<> oWord.Selection.Information(4)
       MESSAGEBOX( "The cursor is on page" +TRANSFORM(oWord.selection.Information(3)) + " of a total of "+;
        TRANSFORM(oWord.Selection.Information(4)))
    oWord.Browser.Next && Skip a Page
ENDDO


Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Thanks Mike, that works great. I poked around the word object browser for what seemed an eternity and still couldn't come up with it!

-suey
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top