
BuiltInDocumentProperties from non-Word text files + testing if a DOC file is a Word file
Hi Michael
take a look at the following article, it may help
How can I get access to the Document Properties of a Word file without
opening the document?
http://www.mvps.org/word/FAQs/MacrosVBA/DSOFile.htm
The key is that if you try to use dsofile to get the properties of a non-OLE
document, dsofile will throw an error. The Listprops template will give you
an idea on how to use the dsofile in your code.
--
Regards
Jonathan West - Word MVP
MultiLinker - Automated generation of hyperlinks in Word
Conversion to PDF & HTML
http://www.multilinker.com
Word FAQs at http://www.multilinker.com/wordfaq
Please post any follow-up in the newsgroup. I do not reply to Word questions
by email
Quote:
> I assumed that asking for
> ActiveDocument.BuiltInDocumentProperties("Creation Date").value
> from a .txt file opened in Word would not get me a result (since I assumed
> text files
> don't carry this sort of information). But it does. However, it doesn't
> actually seem to
> represent the date/time the file was originally created. Looking in the
doc
> Properties it seems what I am getting is the date/time the "Statistics"
page
> was updated, and I suspect it is
> Word being 'helpful' and time-stamping the file with the time it opened it
> (and presumably converted it into a pseudo-Word .doc for the duration).
> Oddly, a Creation Date for the file *is* recorded on the General tab, but
> this is not the date I'm getting. I
> note Word *doesn't* temporarily stamp in an Author property.
> This is rather irritating as I'm getting spurious data and have no way of
> validating it except that the so-called "Creation Date" is *after* the
file
> was last saved! Is there either (a) someway I can get at the actual File
> Creation Date in a .txt file and/or (b) test whether a *.DOC file is
> actually a Word file? I need to be able to test for Word 2, Word 6 and
Word
> 97 files.
> cheers
> Michael