BuiltInDocumentProperties from non-Word text files + testing if a DOC file is a Word file 
Author Message
 BuiltInDocumentProperties from non-Word text files + testing if a DOC file is a Word file

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



Sat, 20 Sep 2003 03:46:32 GMT  
 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



Sat, 20 Sep 2003 07:30:31 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Insert text from a text file into Word doc

2. Saving a Word Doc with text from file

3. Converting .doc Files to Text in Word XP Fails

4. opening a word (.doc) and Text (.txt) file

5. How do you drop doc files from a intranet site into a new word doc

6. How to change or save a MS Word file (*.doc) to a *.html file in VBScript

7. Word HTML file to .doc file.

8. Word HTML file to .doc file.

9. SAving a MS Word file to a PDF file and a text file

10. Crystal Report: Using non .txt files as source of odbc text files

11. Auto Download of doc files into new doc file from a web site

12. Printing multiple Word doc files without opening each in word

 

 
Powered by phpBB® Forum Software