By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,313 Members | 2,725 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,313 IT Pros & Developers. It's quick & easy.

How can I keep outlook open.

P: 55
I have an application which emails out files periodically using Outlook,but if Outlook is closed the emails remain in the Outbox until Outlook is opened again.
How do I get Outlook to remain open until the Outbox is empty?
Need help
Expand|Select|Wrap|Line Numbers
  1. public void chkIF_There_Is_Mail()
  2.         {
  4.             while (oOutboxFolder.Items.Count > 0)
  5.             {
  7.                 Console.WriteLine("There are still Items in Outlook");
  8.             }
  9.             oApp.Quit();
  10.         }
Aug 29 '08 #1
Share this Question
Share on Google+
3 Replies

P: 583
how about checking if outlook is open periodically, by searching for its process, and if it is closed, then tell them they need to open it, and also try to make something that keeps the outlook open, whenever they want to close it, like when i use outlook and msn, before i close outlook it says i have to close msn, because its using something from it, and please remember to use code tags...

Aug 29 '08 #2

P: 55
do you have any code for that?
Aug 29 '08 #3

P: 583
ehh im not sure about an exact code or anything, but here are suggestions...

1) add a handler for one of the process' events which you started. (which are only 4, like .disposed, .exited, .outputdatareceived , .errordatareceived ) but i dont think those will be of use, since when the process has exited, the event would be raised =/

2) in the processstartinfo, try messing around with the .WindowStyle ? it didnt work for me when i tried starting Internet Explorer in hidden mode(or any of them for that matter), but try with your outlook if it doesnt have to be visible..

hope i helped...
Aug 30 '08 #4

Post your reply

Sign in to post your reply or Sign up for a free account.