S
scorpion53061
Does anyone know of a code sample or explanation of how to find the Office
Library (is it 8,9,10,11) on an indiviual computer.
This code detects if it is installed but I am not sure if it will detect if
the right version is installed.. My end user needs Office 2000 or above
versions of excel and word for them to use the reporting functions. If not I
need to disable them. (the reporting functions, not the end user.....)
Public Enum MSApplications
WORD
EXCEL
End Enum
Public Function isInstalled(ByVal App As MSApplications)
Dim strSubKey As String
Select Case App
Case MSApplications.EXCEL
strSubKey = "Excel.Application"
Case MSApplications.WORD
strSubKey = "Word.Application"
End Select
Dim objKey As RegistryKey = Registry.ClassesRoot
Dim objKey1 As RegistryKey = Registry.ClassesRoot
Dim objsubKey1 As RegistryKey =
objKey1.OpenSubKey("Excel.Application")
Dim objSubKey As RegistryKey = objKey.OpenSubKey("Word.Application")
'does not work MsgBox(objKey.GetValue("Word.Application"))
Return Not objSubKey Is Nothing
objKey.Close()
Return Not objsubKey1 Is Nothing
objKey1.Close()
End Function
Library (is it 8,9,10,11) on an indiviual computer.
This code detects if it is installed but I am not sure if it will detect if
the right version is installed.. My end user needs Office 2000 or above
versions of excel and word for them to use the reporting functions. If not I
need to disable them. (the reporting functions, not the end user.....)
Public Enum MSApplications
WORD
EXCEL
End Enum
Public Function isInstalled(ByVal App As MSApplications)
Dim strSubKey As String
Select Case App
Case MSApplications.EXCEL
strSubKey = "Excel.Application"
Case MSApplications.WORD
strSubKey = "Word.Application"
End Select
Dim objKey As RegistryKey = Registry.ClassesRoot
Dim objKey1 As RegistryKey = Registry.ClassesRoot
Dim objsubKey1 As RegistryKey =
objKey1.OpenSubKey("Excel.Application")
Dim objSubKey As RegistryKey = objKey.OpenSubKey("Word.Application")
'does not work MsgBox(objKey.GetValue("Word.Application"))
Return Not objSubKey Is Nothing
objKey.Close()
Return Not objsubKey1 Is Nothing
objKey1.Close()
End Function