Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Interop / September 2005

Tip: Looking for answers? Try searching our database.

How to tell if Outlook interop created new Outlook process

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Rodger Constandse - 29 Sep 2005 16:57 GMT
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

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.