为什么 Perl 和 Word VBA 中的 Word 文档页数不同?
我有一个(一组)Word 文档,我试图使用 Perl 中的 Win32::OLE 获取其各种属性(页数、作者等):
print $MSWord->Documents->Open($name)->
BuiltInDocumentProperties->{"Number of pages"}->value . " \n";
这将返回 4 页。 但文档的实际页数是9。第一部分的页数是4。我想要文档的总页数。
如果在 Word VBA 中执行以下操作:
MsgBox ActiveDocument.BuiltInDocumentProperties("Number of pages")
显示 9。“属性/统计”页面中显示的页数为 9。
是否必须强制重新计算? 有没有办法要求 OLE 库强制重新计算,或者我是否必须单独处理每个部分?
我使用的是 XP、Word 2007、ActivePerl v5.10.0。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)