Another quick detailed info :
Maybe You need the real version-numbers of the installed MS-Office ( not product-name like Word 2007 )
Reads from Registry :
Save this as < CheckOffice.vbs > A dbl-click on this file shows the versions.
Also You can call it from inside Your application.
Winexec('WSCRIPT.exe CheckOffice.VBS')
Dim WSHShell, objFSO, textout
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set WSHShell = CreateObject("WScript.Shell")
Dim part(4,1)
part(0,0) = "Word" : part(1,1) = "WINWORD.EXE"
part(1,0) = "Excel" : part(2,1) = "EXCEL.EXE"
part(2,0) = "Outlook" : part(4,1) = "OUTLOOK.EXE"
part(3,0) = "PowerPoint" : part(0,1) = "POWERPNT.EXE"
part(4,0) = "Access" : part(3,1) = "MSACCESS.EXE"
textout = "Installed Office-Applications :" & vbCRLF & vbCRLF
Call ChkOffice("11.0","2003")
Call ChkOffice("10.0","XP")
Call ChkOffice("9.0", "2000")
Call ChkOffice("8.0", "97")
MsgBox textout,64,"CheckOffice.vbs"
Function ChkOffice(ver, verfull)
Dim pfad, res, helptext
On Error Resume Next
pfad = "HKLM\Software\Microsoft\Office\" & ver & "\Common\InstallRoot\Path"
res = WSHShell.RegRead(pfad)
If res <> "" Then
For i = 0 to 4
If objFSO.FileExists(res&part(i,1)) Then
helptext = part(i,0) & Space(1) & verfull & " (" & objFSO.GetFileVersion(res&part(i,1))&")"
textout = textout & helptext & vbCRLF
End If
Next
textout = textout & vbCRLF
End If
End Function
Best Regards
Uwe
