Outlook Task Still Running

G

Guest

I created a program that opens Outlook and looks for messages in a certain
folder, then closes. I have tried this code to close the application:

outLookApp.Session.Logoff();
outLookApp.Quit();

But the OUTLOOK.EXE task is left running. If I re-run the program, a new
OUTLOOK.EXE task is started. How do I properly close down Outlook and get the
task ended? Any help would be appreciated. Thanks.
 
G

Guest

I'm using C# code, and couldn't find a way to set the app to Nothing.

Peter Marchert said:
Did you tried "Set outLookApp = Nothing"?

--
Peter Marchert
[EDV-Service Marchert]
Homepage: http://www.marchert.de
Excel- und Outlookprogrammierung

I created a program that opens Outlook and looks for messages in a certain
folder, then closes. I have tried this code to close the application:

outLookApp.Session.Logoff();
outLookApp.Quit();

But the OUTLOOK.EXE task is left running. If I re-run the program, a new
OUTLOOK.EXE task is started. How do I properly close down Outlook and get the
task ended? Any help would be appreciated. Thanks.
 
D

Dmitry Streblechenko

outLookApp = null;
GC.Collect();

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

Dan said:
I'm using C# code, and couldn't find a way to set the app to Nothing.

Peter Marchert said:
Did you tried "Set outLookApp = Nothing"?

--
Peter Marchert
[EDV-Service Marchert]
Homepage: http://www.marchert.de
Excel- und Outlookprogrammierung

I created a program that opens Outlook and looks for messages in a
certain
folder, then closes. I have tried this code to close the application:

outLookApp.Session.Logoff();
outLookApp.Quit();

But the OUTLOOK.EXE task is left running. If I re-run the program, a
new
OUTLOOK.EXE task is started. How do I properly close down Outlook and
get the
task ended? Any help would be appreciated. Thanks.
 
G

Guest

I tried that, but the process is still running.

Dmitry Streblechenko said:
outLookApp = null;
GC.Collect();

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

Dan said:
I'm using C# code, and couldn't find a way to set the app to Nothing.

Peter Marchert said:
Did you tried "Set outLookApp = Nothing"?

--
Peter Marchert
[EDV-Service Marchert]
Homepage: http://www.marchert.de
Excel- und Outlookprogrammierung


Dan schrieb:

I created a program that opens Outlook and looks for messages in a
certain
folder, then closes. I have tried this code to close the application:

outLookApp.Session.Logoff();
outLookApp.Quit();

But the OUTLOOK.EXE task is left running. If I re-run the program, a
new
OUTLOOK.EXE task is started. How do I properly close down Outlook and
get the
task ended? Any help would be appreciated. Thanks.
 
D

Dmitry Streblechenko

Does it work if you let the Window messag epump run for a while (e.g. by
displaying a message box)?

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

Dan said:
I tried that, but the process is still running.

Dmitry Streblechenko said:
outLookApp = null;
GC.Collect();

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

Dan said:
I'm using C# code, and couldn't find a way to set the app to Nothing.

:

Did you tried "Set outLookApp = Nothing"?

--
Peter Marchert
[EDV-Service Marchert]
Homepage: http://www.marchert.de
Excel- und Outlookprogrammierung


Dan schrieb:

I created a program that opens Outlook and looks for messages in a
certain
folder, then closes. I have tried this code to close the
application:

outLookApp.Session.Logoff();
outLookApp.Quit();

But the OUTLOOK.EXE task is left running. If I re-run the program, a
new
OUTLOOK.EXE task is started. How do I properly close down Outlook
and
get the
task ended? Any help would be appreciated. Thanks.
 

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