Full Version: Confirm Outlook is available
UtterAccess Discussion Forums > Microsoft® Access > Access Automation
leightonpeter
I have built VBA code to syncronize my Access database contact records with outlook. A change in either record can be updated by clicking a button on my Contact form in Access.
As my program is distributed as a runtime version on some computers without Outlook the necessary reference to the Outlook dll may not be available. I have therefore placed this code in a separate mde file and reference that.
I now need a proceedure to identify if Outlook is available.
If not the syncronization process would not be shown to the customer on those machines, the referrenced database not used and hopefully not lead to errors.
Is it possable to check for the existance of Outlook on the computer without referencing the outlook dll?

Any ideas would be appreciated
Thank you
leightonpeter
Its OK. I found a way around it with the following function.

Public Function checkOutlook() As Boolean
On Error GoTo Err
Dim outlookApp As Object ' Declare variable to hold the reference.

Set outlookApp = CreateObject("outlook.application")

checkOutlook = True

outlookApp.Quit ' When you finish, use the Quit method to close
Set outlookApp = Nothing ' the application, then release the reference.

Exit Function
Err:
checkOutlook = False

End Function

Sorry to waist your time.
Peter Leighton
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.