Detecting Outlook shutdown

F

Federico Delgado

Hi,

I am doing some simple stuff with Outlook interop and got cought in
something a bit silly. To get hold on the running outlook instance I use:

Marshal.GetActiveObject("Outlook.Application")

the problem is that sometimes that call returns a valid outlook instance but
that instance is in the process of shutting down so I run into problems a
couple of lines later. Is there anyway to know if the outlook application is
going down and thus it cannot be considered as a running office application?
something like a flag or a reference being set to null?

Thanks,

Federico.
 

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