Finding version of word used to create document

S

Simon

Where is the version of Word used to create a document stored in the
Word object model? It's not Application.Version - this is the version
used to read it.

Simon Kravis
 
T

Tony Jollans

As far as I know, that information is not available via the object model (if
at all) - it shouldn't, in theory at least, be of any importance.
 
J

Jonathan West

Simon said:
Where is the version of Word used to create a document stored in the
Word object model? It's not Application.Version - this is the version
used to read it.

Hi Simon,

You need to use DSOFILE.dll to read the Application property of the file
when the document is not open in Word.

Getting access to the Document Properties of a Word file
http://www.word.mvps.org/FAQs/MacrosVBA/DSOFile.htm

--
Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup
Keep your VBA code safe, sign the ClassicVB petition www.classicvb.org
 
T

Tony Jollans

That will give you the name of the version which last saved the document,
not the one which created it. Without knowing why it's wanted I can't say if
that's good enough.
 
J

Jonathan West

Tony Jollans said:
That will give you the name of the version which last saved the document,
not the one which created it. Without knowing why it's wanted I can't say
if
that's good enough.

You are correct. there is no way of knowing the version of Word that created
a document if that is different from the version that last saved it.


--
Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup
Keep your VBA code safe, sign the ClassicVB petition www.classicvb.org
 
S

Simon

I need the Word version which created the file in order to flag files
for conversion to current version. DSOleFile works fine for more recent
versions but fails on old omes files eg Word 5.1 for Macintosh. The
version used for creation shows as Type in the General tab of the Word
properties window, so it ought to be accessible through the object
model.
 
J

Jean-Guy Marcil

Simon was telling us:
Simon nous racontait que :
I need the Word version which created the file in order to flag files
for conversion to current version. DSOleFile works fine for more
recent versions but fails on old omes files eg Word 5.1 for
Macintosh. The version used for creation shows as Type in the General
tab of the Word properties window, so it ought to be accessible
through the object model.

As Jonathan and Tony pointed out, that info is in fact the last save
version, not the original Word application used to first create the
document.

Also, on my computer, if I right-click a Word doc to access the properties,
this info is under the Summary tab, not the General one.

I have just tested it with some old documents:

Word 95 - Info not available (DOCILE will not work with these documents
because the information does not exists in the properties. In such a case,
you know this is an old document that needs updating.)
Word 97 - Microsoft Word 8.0
Word 2000 - Microsoft Word 9.0
Word XP - Microsoft Word 10.0
Word 2003 - Microsoft Office Word (Active version on my system)

If I open any of those older documents and save them with Word 2003, the
property automatically changes as if the document was a Word 2003 document
(Which it is now).

For your purpose, I think that is the information in what you want. It does
not matter what Word version was used to create the doc, what counts is the
last version used to save the doc, thus, using DSOFILE you will know which
doc needs updating without having to open any of them..

--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site: http://www.word.mvps.org
 
T

Tony Jollans

The File Type on the General tab is available via the FileSystemObject (or
similar) ...

Set fso = CreateObject("Scripting.FileSystemObject")
MsgBox fso.GetFile("Drive:\And\Path\To\DocName.doc").Type
 
J

Jean-Guy Marcil

Tony Jollans was telling us:
Tony Jollans nous racontait que :
The File Type on the General tab is available via the
FileSystemObject (or similar) ...

Set fso = CreateObject("Scripting.FileSystemObject")
MsgBox fso.GetFile("Drive:\And\Path\To\DocName.doc").Type

Unless I am not looking in the right place (or in the right place but
looking incorrectly!), from what I have seen, the file type tells you it is
a Word document, not the Word version.

--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site: http://www.word.mvps.org
 
T

Tony Jollans

I was just answering the question as to how to get the Type.

I agree with you that it will probably always say "Microsoft Word
Document" - I believe it is effectively a translation of ".doc" from the
registry.
 

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

Top