Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 394
  • Last Modified:

Outlook integration


I created an application that has a feature that can integrate with MS outlook. Not all the users of this app have outlook and would like to use the integration feature.

I am using vb6, how can i check if the correct version of outlook is installed, and if not skip over the outlook intgration code.

Thanks

0
rovi
Asked:
rovi
1 Solution
 
p_sieCommented:
check if the folder of office exists is a quick and easy way.
0
 
David LeeCommented:
I can think of two other ways to check.  One, check the registry and see if Outlook is installed.  I don't know what key to look for though.  Two, the following code checks the version of Outlook.  If Outlook isn't installed, then creating the Outlook.Application object will fail and the OnError code can return a value indicating that Outlook isn't installed.  The code is pretty simple and straightforward so it should get the job done.  However, I suppose something other than Outlook not being installed could cause an error in which case the function would say Outlook isn't installed when in fact it is.  You could also modify the function to return a boolean value instead of the version number.

Function CheckOLVersion()
   On Error GoTo Outlook_Not_Installed
   Dim objOutlook As Outlook.Application
   Set objOutlook = New Outlook.Application
   CheckOLVersion = objOutlook.Version
   Set objOutlook = Nothing
   Exit Function
Outlook_Not_Installed:
   CheckOLVersion = "Not Installed"
End Function

If CheckOLVersion() <> "Not Installed" Then
   Execute Outlook Integration Code
End If
0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now