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

How determine user's office version via VBS?

Status
Not open for further replies.

youngso

Technical User
Nov 17, 2009
2
Here is quick and simple method to check office version via VBS?

Set objWord = CreateObject("Word.Application")
Select Case objWord.Version
Case "12.0" MsgBox ("Office 2007 is installed")
Case "11.0" MsgBox ("Office 2003 is installed")
Case "10.0" MsgBox ("Office 2000 is installed")
End Select
objWord.Quit

Or you could create a function out the above action to do other things.
 
FYI:
Code:
Set objWord = CreateObject("Word.Application")
    Select Case objWord.Version
    Case "12.0" MsgBox ("Office 2007 is installed")
    Case "11.0" MsgBox ("Office 2003 is installed")
    Case "10.0" MsgBox ("Office 2002 (XP) is installed")
    Case "90.0" MsgBox ("Office 2000 is installed")
    End Select
objWord.Quit

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
OOps, sorry for the typo:
Code:
Set objWord = CreateObject("Word.Application")
    Select Case objWord.Version
    Case "12.0" MsgBox ("Office 2007 is installed")
    Case "11.0" MsgBox ("Office 2003 is installed")
[!]    Case "10.0" MsgBox ("Office 2002 (XP) is installed")
    Case "9.0" MsgBox ("Office 2000 is installed")[/!]
    End Select
objWord.Quit

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Hmm, that might be useful! Is there a way to tell where the .exe for each version is located?

For instance if a user has both Access 97 and Access 2003 and you want to force a database to open with A97 you could run A97's .exe or something.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top