A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Add-ins for Outlook
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Outlook.exe - how to kill?



 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old September 18th 06, 03:49 PM posted to microsoft.public.outlook.program_addins
[email protected]
external usenet poster
 
Posts: 17
Default Outlook.exe - how to kill?

Hi All,

Of all the posts out there, Outlook.exe doesnot disappear from task
manager mainly due to add-ins still referencing it.

I open outlook manually and the add-in loads, performs its functions
and then when I close outlook the Outlook.exe process gracefully
terminates. Yes, it does terminate all by itself so that would imply
the add-in cleans up after itself. Correct?

The problem arises when I open Outlook from C# (VS 2005) application
(to the calendar). The Outlook.exe lingers in the process list long
after the process is killed. The code is as follows:
Outlook.ApplicationClass oOutlook = new
Outlook.ApplicationClass();
Outlook.Application appOutlook = new Outlook.Application();
Outlook.MAPIFolder oCalendar;
Outlook.Explorer oEx = oOutlook.ActiveExplorer();

oCalendar = null;

if (oEx != null)
{
oCalendar =
oOutlook.Application.GetNamespace("MAPI").GetDefau ltFolder(Outlook.OlDefaultFolders.olFolderCalendar );
oEx.CurrentFolder = oCalendar;
((Outlook._Explorer)oEx).Activate();
}
else
{
oCalendar =
appOutlook.GetNamespace("MAPI").GetDefaultFolder(O utlook.OlDefaultFolders.olFolderCalendar);
oCalendar.Display();
}

oCalendar = null;
oEx = null;
appOutlook = null;
oOutlook = null;
GC.Collect();
GC.WaitForPendingFinalizers();
GC.Collect();
}
}

In the add-in, I handle the Explorer.Close and Inspector.Close events
and when ApplicationObject.Explorers.Count() = 0 and
ApplicationObject.Inspectors.Count() = 0, here is what I do...
oCalendarItem = Nothing
oDeletedItem = Nothing
oExplorer = Nothing
oInspector = Nothing
cInspector = Nothing
addInInstance = Nothing
Marshal.ReleaseComObject(addInInstance)
ApplicationObject = Nothing
GC.Collect()
GC.WaitForPendingFinalizers()
GC.Collect()

What am I doing wrong plzzzz???

Thanx

 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
msimn.exe (Outlook Express) deango Outlook Express 12 September 23rd 06 03:52 AM
Find and run Outlook.exe Culverin Outlook and VBA 3 August 28th 06 09:22 PM
Outlook 2000 SCANCAL.EXE mcguganw Outlook - Calandaring 5 July 8th 06 10:32 PM
Outlook Express runs without .exe DiscoNap9000 Outlook Express 3 May 30th 06 12:18 AM
outlook.exe-application error ramosp1 Outlook - Using Contacts 0 March 10th 06 10:38 PM


All times are GMT +1. The time now is 12:15 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.