Is Outlook installed and what version?


In this VB.Net Tutorial/Code Example, I’m going to provide you with a simple class that allows for you to check whether Outlook is installed on the computer and also figure out which version of the Outlook it is.

{code}Imports Microsoft.Win32

Namespace MS.Office
Public Class Outlook
Public Shared Function isInstalled() As Boolean
Dim regClasses As RegistryKey = Registry.ClassesRoot
Dim rtn As Boolean

Dim reg As RegistryKey = regClasses.OpenSubKey(“Outlook.Application”)
If reg Is Nothing Then
rtn = False
rtn = True
End If

Return rtn
End Function

Public Shared Function version() As String
Dim rtn As String = “”
Dim objApp As Object

If isInstalled() Then
objApp = CreateObject(“Outlook.Application”)
rtn = objApp.Version
End If

Return rtn
End Function
End Class
End Namespace{/code}