Man... if you guys have this many different versions of Office installed I guess there is nothing to say for STANDARDS

What do you see the real intent of such a UDF?

Isn't something small like this good enough?
Change the $file maybe to a parameter.

Why do you need to know everything made/sold in Office by Microsoft for the past 5 years?

Don't patch, UPGRADE everyone to the latest version you're licensed for.


Dim $iRC
$iRC=SETOPTION('Explicit','ON')
$iRC=SETOPTION('NoVarsInStrings','ON')

GetOfficeVersion

Function GetOfficeVersion()
DIM $file,$nul,$path,$version,$app,$index,$HKLMAppPaths
$HKLMAppPaths = 'HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths'
IF EXIST('%temp%\@WKSTA.LOG')
DEL ('%temp%\@WKSTA.LOG')
ENDIF
$file = '%temp%\@WKSTA.LOG'
$nul = writeprofilestring($file,'@WKSTA','User','@userid')
while @error = 0
$app = enumkey($HKLMAppPaths+'\',$index) $index = $index + 1
select
case $app = 'excel.exe'
$path = readvalue($HKLMAppPaths+'\'+$app,'path')
$version = getfileversion($path+'\'+$app,'Productversion')
$nul = writeprofilestring($file,@WKSTA,$app,$version)
case $app = 'winword.exe'
$path = readvalue($HKLMAppPaths+'\'+$app,'path')
$version = getfileversion($path+'\'+$app,'Productversion')
$nul = writeprofilestring($file,@WKSTA,$app,$version)
case $app = 'powerpnt.exe'
$path = readvalue($HKLMAppPaths+'\'+$app,'path')
$version = getfileversion($path+'\'+$app,'Productversion')
$nul = writeprofilestring($file,@WKSTA,$app,$version)
case $app = 'msaccess.exe'
$path = readvalue($HKLMAppPaths+'\'+$app,'path')
$version = getfileversion($path+'\'+$app,'Productversion')
$nul = writeprofilestring($file,@WKSTA,$app,$version)
case $app = 'mspub.exe'
$path = readvalue($HKLMAppPaths+'\'+$app,'path')
$version = getfileversion($path+'\'+$app,'Productversion')
$nul = writeprofilestring($file,@WKSTA,$app,$version)
case $app = 'winproj.exe'
$path = readvalue($HKLMAppPaths+'\'+$app,'path')
$version = getfileversion($path+'\'+$app,'Productversion')
$nul = writeprofilestring($file,@WKSTA,$app,$version)
case $app = 'visio32.exe'
$path = readvalue($HKLMAppPaths+'\'+$app,'path')
$version = getfileversion($path+'\'+$app,'Productversion')
$nul = writeprofilestring($file,@WKSTA,$app,$version)
case $app = 'outlook.exe'
$path = readvalue($HKLMAppPaths+'\'+$app,'path')
$version = getfileversion($path+'\'+$app,'Productversion')
$nul = writeprofilestring($file,@WKSTA,$app,$version)
endselect
loop
EndFunction


[ 26. September 2003, 06:41: Message edited by: NTDOC ]