Hello,
I have a WinForm application that interacts with Outlook using interop.
Is there a way to tell if the 'new MSOutlook.Application()' call is actually
creating a new Outlook process, or it is using an existing Outlook process?
I want to terminate the Outlook process if it was spawned by my application
during the interop (calling Quit on the Application object), but not if Outlook
was already running when I started the interop.
Is there an easy way to do this, or do I have to search the processes?
Thanks in advance,
Rodger
Robert Jordan - 30 Sep 2005 15:30 GMT
> Hello,
>
[quoted text clipped - 3 lines]
> actually creating a new Outlook process, or it is using an existing
> Outlook process?
You have to call Marshal.GetActiveObject ("progId").
"progId" is the COM prog id of the MSOutlook.Application class.
I don't have Outlook, so I cannot exactly tell you its prog id.
It's probably "Outlook.Application".
Rob
Willy Denoyette [MVP] - 30 Sep 2005 15:58 GMT
If outlook is allready running, it connects to the running instance, if it's
not running it starts a instance.
Willy.
> Hello,
>
[quoted text clipped - 12 lines]
> Thanks in advance,
> Rodger