in reply to Win32::OLE: How to get the page number from ms-word?

I have written a small amount of code using the msWord Object automation - based on that experience, I think you need to select the word, then get the Information you need.

Something like this (Not syntax checked, object model not verified, and not tested:

## Within the for loop -- my $selection = $doc->Words->Item($i)->Select(); $page = $selection->Information(wdActiveEndPageNumber);

     "For every complex problem, there is a simple answer ... and it is wrong." --H.L. Mencken

Replies are listed 'Best First'.
Re^2: Win32::OLE: How to get the page number from ms-word?
by Albannach (Monsignor) on Mar 25, 2006 at 17:53 UTC
    Very close - I was curious so I verified this version (Select doesn't appear to return anything, so you have to create the selection first, then ask the document for information about it later):
    $doc->Words->Item($i)->Select; my $page = $word->Selection->Information(wdActiveEndPageNumber);

    --
    I'd like to be able to assign to an luser