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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

getting document version

Status
Not open for further replies.

jpaaron

Programmer
Jul 27, 2001
5
US
How can you get the version of a Word document with VB 6.0? That is, how can you tell if a document was saved as a Word 2000 *.doc or a Word 95 *.doc?

Your help is appreciated.

-Jason
 
Hello

Do the following

Code:
Dim Word as object, WordType as String 

Set Word = CreateObject("Word.Basic")
WordType = Word.appinfo$(2)

Select case wordtype
case "9.0"
     'Word 2000
case "8.0"
     'Word 97
case Else
     'Word 95
end Select

Then you can set the word object to the specific word type i.e.
If WordType = "9.0" Then
'word 2000
Set Word = CreateObject("Word.Application.9")
Else
'word 97
Set Word = CreateObject("Word.Application.8")
End If


Hope this helps
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top