Hello,
How can I check in FWH which office version is installed or is active on my computer ?
Thanks a lot in advance.
oWord := CREATEOBJECT( "Word.Application" )
Msginfo(oword:Version)
//12 = WORD 2007
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
static function MSOfficeVer()
local oReg, nVer := 0
oReg := TReg32():New( HKEY_LOCAL_MACHINE, ;
"SOFTWARE\Microsoft\Office\Common" )
nVer := oReg:Get( 'LastAccessInstall', nVer )
oReg:Close()
return nVer
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: Google [Bot], karinha, nageswaragunupudi and 60 guests