Detect the presence of Outlook

G

Guest

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top