Detect the presence of Outlook

P

ppp01

Hi all,

I am writing C# for the automation for Outlook.
In the C# program, I need to include the import directives for the outlook
reference.
However, if when deploy the solution, the client pc does not install outlook,
then the program will throw exception. So how can I detect the presence
of outlook in the client pc, and how not to write the import directives for
the outlook coz it will cause exception ?

Thanks
 
D

Dmitry Streblechenko

Trap the error when creating an instance of the Outook.Application object
and assume Outlook is not installed if an error is raised.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
 
Top