Need script to read Page Size for Word and Excel (2003) files

O

ota9303

I am working on a project that requires for us to create thousand of
Word and Excel documents in metric sizes (A3 & A4) that will have to
be turned over to the client so I need to monitor their creation from
the beginning to make sure our people do not use English sizes (8.5x11
or 11x17). I know that a Word file can have different sizes (in
sections) so I would be looking to check the first section only. I do
not want a routine to “open & close” each file so that I don’t risk
conflict or an error. I am looking for something that will externally
scan a directory (or directories) and report out the page size
setting. That will help me fix problems as I find them and not wait
until the end.

Any suggestions? Do you think this could be scripted by a wiz
programmer?
 
D

David Horowitz

Interesting challenge...!
I hear you say you don't want to open each file. But when you get right down
to it, somehow each file will need to be opened by the file system in order
to inspect it's page size setting. Either that or you've got to write some
code to log the page size every time a file is edited. But if you want to
just look at a folder and check the page sizes, somehow or other that file
will need to be "peeked" into, even if it's done in Win32 API code to just
open the file in a real loose mode and let's say you knew which exact byte
to look into for the information (well, you'd really need to know the
internal Word file storage format). If you did end up opening each file in
Word, you could try opening in ReadOnly mode (Documents.Open
FileName:="myfile.doc", ReadOnly:=True).
I'm not sure this helps...
--
David Horowitz
Lead Technologist
Soundside Inc.
www.soundside.biz
I am working on a project that requires for us to create thousand of
Word and Excel documents in metric sizes (A3 & A4) that will have to
be turned over to the client so I need to monitor their creation from
the beginning to make sure our people do not use English sizes (8.5x11
or 11x17). I know that a Word file can have different sizes (in
sections) so I would be looking to check the first section only. I do
not want a routine to “open & close” each file so that I don’t risk
conflict or an error. I am looking for something that will externally
scan a directory (or directories) and report out the page size
setting. That will help me fix problems as I find them and not wait
until the end.

Any suggestions? Do you think this could be scripted by a wiz
programmer?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top