View Single Post
  #3   Report Post  
Posted to microsoft.public.word.docmanagement
VinayBarnwal
 
Posts: n/a
Default How to check whether a word document is empty?

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

"Cindy M -WordMVP-" wrote:

Hi ?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 :-)