Board index » delphi » Not a Delphi Specific Q: MS-WORD Format?

Not a Delphi Specific Q: MS-WORD Format?

Quote
Eric Miles (mil...@usafe14.ramstein.af.mil) wrote:

: Does anyone out there know the format of an MS Word Document?   I
: searched MS for the info but found none.  Is it public knowledge?  I
: am trying to read in the Author and comments info from a doc file
: without opening it.

You neglected to mention which version of MS Word. Each of them seems
to have their own formats, unfortunately. Word for Windows 6? Word for
Windows 2? Word for Macintosh? Word for DOS?

I'll assume that you mean Word 6 for Windows. It, like Excel 5 for
Windows, is a big OLE-rich document format, setting up effectively
a filesystem within the single document itself. I've seen a Microsoft
published book which describes the Excel 5 format (which has the same
header as a Word 6 document), so I can only guess that there is a
similar book pertaining to Word.

Alternatively, you could write a Delphi application which opens
a DDE or OLE link to Word, and your program asks Word who the
Author is. Slow, but give me well documented file formats anyday.

Aaron

 

Re:Not a Delphi Specific Q: MS-WORD Format?


In article <4eho99$...@harbinger.cc.monash.edu.au>
           w...@aurora.cc.monash.edu.au "Mr A Wigley" writes:

Quote
> Eric Miles (mil...@usafe14.ramstein.af.mil) wrote:
> : Does anyone out there know the format of an MS Word Document?   I
> : searched MS for the info but found none.  Is it public knowledge?  I
> : am trying to read in the Author and comments info from a doc file
> : without opening it.

<SNIP>

Quote
> Alternatively, you could write a Delphi application which opens
> a DDE or OLE link to Word, and your program asks Word who the
> Author is. Slow, but give me well documented file formats anyday.

I think the Author is right near the tail end of the file - if
you examine a selection of Word files in a hex editor you
should be able to figure out what demarcates this field. Try
opening and saving some of these files only changing the Author
and Comments and see what changes. A little detective work goes
a long way

Another solution is to get the file:
ftp://sunsite.icm.edu.pl/pub/delphi/freeware/wordapi.zip    

This contains units that ope n the "back door" to Word (much
better than DDE) [and also allow you to write Word .WLL
"add-ins"]. You can then use Word's own FileFind facility to
generate a list of files by a certain author (specifying
drives, directories, dates, etc. if you wish). These searches
can be saved and appear in the Winword directory in as a file
like _fm_0000.idx - the format of which is not too hard to
decipher or parse. You could also get Word to output the
filenames and comments to a text file.

- Chris

--
Christopher J Fynn <cf...@sahaja.demon.co.uk>

Re:Not a Delphi Specific Q: MS-WORD Format?


Quote
mil...@usafe14.ramstein.af.mil (Eric Miles) wrote:
>Does anyone out there know the format of an MS Word Document?   I
>searched MS for the info but found none.  Is it public knowledge?  I
>am trying to read in the Author and comments info from a doc file
>without opening it.

Haven't seen a doc entitled such, but U might want to have a look at
the MS Word Viewer and it's white paper (available from ftp.microsoft.com)
which may give you some invaluable pointers.  Since MS want the Word 6
document format to be the 'standard', phone MS up, and I'm sure they
will help....

-M

Re:Not a Delphi Specific Q: MS-WORD Format?


Quote
>Does anyone out there know the format of an MS Word Document?   I
>searched MS for the info but found none.  Is it public knowledge?  I
>am trying to read in the Author and comments info from a doc file
>without opening it.

Word use OLE2's structured storages (or compound files) to save a
document. This format is quite complicated if you want to parse
the whole file, but you can easily retrieve the author/comments fields.
An example of how to proceede is given (C++)
in the following book (excellent IMHO): "Using OLE 2.x in Application
Development", QUE, ISBN 1-56529-991-4.

David

--
David Brabant,             | E-mail: David.Brab...@csl.sni.be
Siemens Nixdorf (SNI),     | CIS:    100337,1733
Centre Software de Lige,  | X-400:  C=BE;A=RTT;P=SCN;O=SNI;OU1=LGG1;OU2=S1
2, rue des Fories,         |         S=BRABANT;G=DAVID
4020 Lige (BELGIUM)       | HTTP:   www.sni.de       www.csl.sni.be/~david

Other Threads