Detect outlook is running (and not shutting down)

  • Thread starter Thread starter Federico Delgado
  • Start date Start date
F

Federico Delgado

Hi,

I am developing some code for outlook right now and the way I am detecting
the application running is by doing:

Marshal.GetActiveObject("Outlook.Application");

If I get a comexception then outlook is not running. The problem is that
sometimes this catches a dying outlook instance and the rest of my code tries
to execute against this non existent instance with all kind of errors.

Is there any way to get the current instance and ensure that it was not in
the middle of a closing process?

Thanks,

Federico
 
I don't know of any way to do that. You probably will need to use exception
handling for that, possibly with periodic checks to see if the Outlook
window is still there.
 

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

Back
Top