Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Word Version

Status
Not open for further replies.

Zig999

Programmer
Nov 8, 2005
20
BR
I´m opening a series of documents and I need to know in what version of Word witch one of this documents was made, like Word 97, 2000, 2002...

Thank you

Zig
 
Thanks for posting.

But this property get me the version of the Word currently running. I need the version of the Word used to make the document in the first time.

Thanks again.
 
You should be able to get it from the DocumentProperty. One of the BuiltInDocumentProperties is Application Name. This is stored within the file.

Code:
ActiveDocument.BuiltInDocumentProperties("Application Name")

There is also Application.Build, but I think this only applies to the current loaded version - it is not stored with the file.

I have no other version files to test with, so I am not 100% this would work for you. It will NOT work for you if the file is saved with a later version...but then it would not matter would it?



Gerry
 
Thanks Gerry.

I tried to use this property as you recomend. The result was the same of Chance's sugestion. It returns me tha current application version, and not the documents.

Maybe you can give me another idea.
My object is that I have diferent actions for documents made in Word 97, 2000 and 2003. Any sugestions of how could you identify and apply this actions?

Thanks

Zig
 
Download the DSOfile.dll from here:

The you may use this function:
Code:
Function getAppVersionFromDoc(strPath As String)
Dim ODP As Object, SP As Object
Set ODP = CreateObject("DSOFile.OleDocumentProperties")
ODP.Open strPath, True
Set SP = ODP.SummaryProperties
getAppVersionFromDoc = SP.ApplicationName
ODP.Close
Set SP = Nothing: Set ODP = Nothing
End Function

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top