Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: Indexing of Word documents

by davies (Vicar)
on Jun 08, 2013 at 11:26 UTC ( #1037842=note: print w/ replies, xml ) Need Help??


in reply to Indexing of Word documents

My understanding - and that's liable to be very wrong - is that a page number is a very ephemeral thing in Word and therefore not stored in the file. The issue is that it depends on the computer and the available printers. The available fonts and the selected paper size have a major effect on the pagination, so this is not decided by Word until print time. Therefore, any page number you get out of Word is going to be unreliable and my understanding is that, while it can be calculated by Word most of the time given a configuration, it won't store that information and therefore it can't be extracted from a different machine.

Regards,

John Davies


Comment on Re: Indexing of Word documents
Re^2: Indexing of Word documents
by sundialsvc4 (Abbot) on Jun 08, 2013 at 14:51 UTC

    Your assumption is correct ... and it is even more ephemeral since it also depends on the page dimensions.   The 8-1/2x11 paper that’s common in USA, versus the A4-or-whatever page in Europe, and so on ... your default margins ... even font size.   OLE is going to be necessary here ... or ...

    What about Visual Basic or VBA?   Seriously:   it’s built-in to Word anyway, and it can instantiate a Word.Document object, and ... heck, it even has regexes buried in there someplace.   Maybe it could (“if I on-ly had a brai-i-in...”)   ;-)   do the first-step of finding words and page numbers, writing that to a file for consumption by more-intelligent beings.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1037842]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (11)
As of 2014-12-19 10:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (78 votes), past polls