Outlook/Outlook Expresss Installed

J

JimP

How can I determine whether or not Outlook or Outlook Express has been
installed locally on a pc (VBA code)?
 
D

Daniel Pineault

For Outlook, simply try initiating an Outlook Object. If no error is raised,
it is installed, otherwise it is not. Try something like:

Function OlkInst() As Boolean
On Error Resume Next
Dim objOutlook As Object

Set objOutlook = CreateObject("Outlook.Application")
OlkInst = (Err.Number = 0)

End Function
--
Hope this helps,

Daniel Pineault
For Access Tips and Examples: http://www.cardaconsultants.com/en/msaccess.php
If this post was helpful, please rate it by using the vote buttons.
 
J

JimP

Thank you. Even with Outlook loaded on the pc, a reference must also be set
to the "Microsoft Outlook 11.0 Object Library". Is there a way to determine
if this reference has been set?
 
D

Douglas J. Steele

Daniel's example is using Late Binding, which means that no reference is
required.
 
D

Daniel Pineault

My code does not require a reference to any library, but if you are saying
that your code requires the library, then I personally would suggest that you
change you code to use late binding. This would eliminate the need for the
reference library to be explicitly selected.

I would also suggest you take a look at
http://groups.google.ca/group/comp....heck+for+"reference+library"#d2e3d645ce22bcdf

The link Douglas gives in the post is an excellent resource!
--
Hope this helps,

Daniel Pineault
For Access Tips and Examples: http://www.cardaconsultants.com/en/msaccess.php
If this post was helpful, please rate it by using the vote buttons.
 
Top