For Programmers: Free Programming Magazines  


Home > Archive > Visual Basic > September 2004 > determine ms office version









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author determine ms office version
Tarren

2004-09-30, 3:55 pm

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

2004-09-30, 3:55 pm

Registry key that you may be able to check:
HKCU\Software\Microsoft\Office

Registry Component:
http://www.vbaccelerator.com/home/V...rol/article.asp

--or--
How to Determine Programmatically If Office XP Is Installed
http://www.microsoft.com/office/ork...rn/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

--
Chris Hanscom
MVP (Visual Basic)
http://www.veign.com
--

"Tarren" <noemail@thankyou.com> wrote in message
news:%23fJlnQvpEHA.1160@tk2msftngp13.phx.gbl...
> 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
>
>



alpine

2004-09-30, 3:55 pm

On Thu, 30 Sep 2004 09:48:20 -0400, "Tarren" <noemail@thankyou.com>
wrote:

>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



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
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com