How to check whether a word document is empty?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,
I am trying to filter out the empty word documents of different versions
which include Word 95 document too. Is there an API which can do this without
actually opening the word document?

I have tried to get this work done using the combination of "checksum" &
"size" of the documents. I have got the list of mappings of "checksum" &
"size" for all empty word documents from a sample of 1000 documents including
95 documents too. Do you have any idea upto what % this way will give me the
correct result?

Your suggestions are welcome.
Thanks,
Vinay
 
Hi =?Utf-8?B?VmluYXlCYXJud2Fs?=,
I am trying to filter out the empty word documents of different versions
which include Word 95 document too. Is there an API which can do this without
actually opening the word document?

I have tried to get this work done using the combination of "checksum" &
"size" of the documents. I have got the list of mappings of "checksum" &
"size" for all empty word documents from a sample of 1000 documents including
95 documents too. Do you have any idea upto what % this way will give me the
correct result?
I don't think anything like this would work. A document could contain
properties, styles and other things that would affect the document size, as well
as the binary contents, and still be "empty". You'd have to be able to
programmatically read (and understand) the binary file structure, which changed
substantially going from Word95 to 97. Through Microsoft, you can request the
binary file structure information, but only for the most recent version.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or reply
in the newsgroup and not by e-mail :-)
 
I really appreciate you for your time to answer the same.
In fact in my case, I don't care if there are any styles or properties but
no charecter.
I want to find out such documents which do not have any charecter, there
could be styles and properties.
Please let me know your thoughts.
Thanks,
Vinay
 
One of Word's built-in properties is the number of characters. I believe it
is possible to access document properties without opening the file, but
possibly not for (and certainly not in) Word 95 since it requires VBA. See
http://word.mvps.org/faqs/macrosvba/DSOFile.htm

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA

Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.
 
Thanks for your time to reply. Actually I am looking for the solution which
can work for word 95 as well and my requirement is to programatize that
component so that without actually opening the document I can know the number
of charecters.
 
You might try the download anyway. It may well work for Word 95 files is
used in a later version.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA

Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.
 

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

Back
Top