How can I keep outlook open.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • napstar
    New Member
    • Nov 2006
    • 55

    How can I keep outlook open.

    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
    Code:
    public void chkIF_There_Is_Mail()
            {
    
                while (oOutboxFolder.Items.Count > 0)
                {
    
                    Console.WriteLine("There are still Items in Outlook");
                }
                oApp.Quit();
            }
    Last edited by Curtis Rutland; Aug 30 '08, 06:15 AM. Reason: Added code tags -- Please use the # button
  • joedeene
    Contributor
    • Jul 2008
    • 579

    #2
    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...

    joedeene

    Comment

    • napstar
      New Member
      • Nov 2006
      • 55

      #3
      do you have any code for that?
      Last edited by Curtis Rutland; Aug 30 '08, 06:14 AM. Reason: Removed unnecessary quote

      Comment

      • joedeene
        Contributor
        • Jul 2008
        • 579

        #4
        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, .outputdatarece ived , .errordatarecei ved ) but i dont think those will be of use, since when the process has exited, the event would be raised =/

        2) in the processstartinf o, 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...
        joedeene

        Comment

        Working...