I would like to get the latest version of Office installed on a users machine, I am using the code below but it brings back all the versions of Office installed but I am looking for the most current.
Is there code that will get the current Office install?
I will continue to search the Inet and if I find something, I will post it.
ls_key = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office"
li_rtn = RegistryKeys(ls_key, ls_subkeylist)
ls_key += "\"
j = UpperBound(ls_subkeylist)
for i=1 to j
li_rtn = RegistryValues(ls_key + ls_subkeylist[i] + "\Common\InstallRoot", ls_valuearray)
if li_rtn = 1 then
ls_ver1 = ls_subkeylist[i] // 14.0
ls_return = ls_subkeylist[i]
messagebox('MS Office: ' , ls_return)
//exit
end if
next
Returns in this order:
11.0
12.0
9.0
Office versions:
Office 97 - 7.0
Office 98 - 8.0
Office 2000 - 9.0
Office XP - 10.0
Office 2003 - 11.0
Office 2007 - 12.0
Office 2010 - 14.0
Office 2013 - 15.0
Thank you,
William