I have to write an auto patcher for all of the client pcs, but some are
running different versions of office.
How can I determine which version of Microsoft Office is installed? Do I
get it from the registry?
Thanks
Veign - 30 Sep 2004 15:12 GMT
Registry key that you may be able to check:
HKCU\Software\Microsoft\Office
Registry Component:
http://www.vbaccelerator.com/home/VB/Code/Libraries/Registry_and_Ini_Files/Compl
ete_Registry_Control/article.asp
--or--
How to Determine Programmatically If Office XP Is Installed
http://www.microsoft.com/office/ork/xp/journ/prog0001.htm
--or--
Code that may help - run something similar against a known application
installed (Word may be better):
Public Function ExcelVersion() As String
On Error GoTo Hell
'Attempt to create an Excel object
Dim objExcel As Object
Set objExcel = CreateObject("Excel.Application")
'Retrieve the version
ExcelVersion = "MS Excel v" & objExcel.Version
'Destroy the object
Set objExcel = Nothing
Exit Function
Hell:
ExcelVersion = "(not found)"
End Function

Signature
Chris Hanscom
MVP (Visual Basic)
http://www.veign.com
--
> I have to write an auto patcher for all of the client pcs, but some are
> running different versions of office.
[quoted text clipped - 3 lines]
>
> Thanks
alpine - 30 Sep 2004 15:34 GMT
>I have to write an auto patcher for all of the client pcs, but some are
>running different versions of office.
[quoted text clipped - 3 lines]
>
>Thanks
You can query the following registry key to get the current Word
version which, in most cases, will equate to the current Office
version....
HKEY_CLASSES_ROOT\Word.Application\CurVer
HTH,
Bryan
____________________________________________________________
New Vision Software "When the going gets weird,"
Bryan Stafford "the weird turn pro."
alpine_don'tsendspam@mvps.org Hunter S. Thompson -
Microsoft MVP-Visual Basic Fear and Loathing in LasVegas