VBscript to Determine if Outlook is installed

I am writing a script that will do one thing if outlook is installed, and do another if outlook isn’t installed.  I tried all kinds of logical file checks etc to see if the outlook binaries existed, but it got complicated. 

I decided to see if the outlook object would successfully initialize.  If I cannot connect to the outlook application, then I can probably assume that outlook is not installed:

on error resume next
Set objOutlook = CreateObject("Outlook.Application")
If objOutlook Is Nothing Then
    wscript.echo "Outlook 2007 is NOT installed, or is not installed correctly!"
else
wscript.echo "Outlook 2007 is installed on this PC."
end if

Advertisements

2 responses to “VBscript to Determine if Outlook is installed

  1. Here is what I did, with your idea as the starting point:\’*****************************************dim xdim OutlookVerOn Error Resume Nextset Outlook = Createobject("Outlook.Application")if not Err.Number then    x = instr(1, Outlook.Version, ".")    OutlookVer = left(Outlook.Version, x) + mid(Outlook.Version, x+1, 1)else    OutlookVer = "0"    RegNewKey = ""    RegReplyKey = ""end if\’*********************************This will give you the Outlook version (Outlook 2007  reports 12.0, Outlook 2003 reports 11.0, etc). If Outlook is not installed, it should report 0, although I haven\’t tested that condition. It has worked successfully for both O2007 and O2003, and should for any version of Outlook.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s