I have a (set of) Word document(s) for which I'm trying to get various properties (number of pages, author, etc) using Win32::OLE in Perl:
print $MSWord->Documents->Open($name)->
BuiltInDocumentProperties->{"Number of pages"}->value . " \n";
This returns 4 pages. But the actual number of pages in the document is 9. The number of pages in the first section is 4. I want the total number of pages in the document.
If, within Word VBA, I do the following:
MsgBox ActiveDocument.BuiltInDocumentProperties("Number of pages")
This displays 9. The number of pages displayed in the Properties/Statistics page is 9.
Do I have to force a recalculate? Is there some way to ask the OLE library to force a recalculate or do I have to treat every section separately?
I'm on XP, Word 2007, ActivePerl v5.10.0.