none
Require code which can check either outlook running or not RRS feed

  • Question

  • Hi All,

    I need code which I can put at the installer custom action (before installing addin for outlook) that it should check to see if outlook is running and if it is force the used to shut down the outlook so that the installer can run to completion.

    Any immediate help will be much appreciated.

     

    Thanks

    --Mehnaz

     


    Mehnaz Anwar
    Friday, September 16, 2011 6:50 AM

Answers

  • Hi,

    Try this:

    public bool IsOutlookProcessRunning()
            {
                string processName = "outlook";
                foreach (Process process in Process.GetProcesses())
                {
                    if (process.ProcessName.StartsWith(processName, StringComparison.InvariantCultureIgnoreCase))
                    {
                        return true;
                    }
                }
                return false;
            }
    


    • Proposed as answer by Carlos Mallen Wednesday, September 21, 2011 12:47 AM
    • Marked as answer by Mehnaz13 Thursday, September 22, 2011 9:04 AM
    Saturday, September 17, 2011 10:17 AM

All replies

  • Language?

    --
    Ken Slovak
    MVP - Outlook
    http://www.slovaktech.com
    Author: Professional Programming Outlook 2007
     
     
    "Mehnaz13" <=?utf-8?B?TWVobmF6MTM=?=> wrote in message news:edd0b6c7-6904-41b0-a411-3c5e74e89e02...

    Hi All,

    I need code which I can put at the installer custom action (before installing addin for outlook) that it should check to see if outlook is running and if it is force the used to shut down the outlook so that the installer can run to completion.

    Any immediate help will be much appreciated.

     

    Thanks

    --Mehnaz

     


    Mehnaz Anwar

    Ken Slovak MVP - Outlook
    Friday, September 16, 2011 1:17 PM
  • Hi,

     

    thanks...using vs.net2008 + vsto and language C#

    --Mehnaz


    Mehnaz Anwar
    Saturday, September 17, 2011 2:41 AM
  • Hi,

    Try this:

    public bool IsOutlookProcessRunning()
            {
                string processName = "outlook";
                foreach (Process process in Process.GetProcesses())
                {
                    if (process.ProcessName.StartsWith(processName, StringComparison.InvariantCultureIgnoreCase))
                    {
                        return true;
                    }
                }
                return false;
            }
    


    • Proposed as answer by Carlos Mallen Wednesday, September 21, 2011 12:47 AM
    • Marked as answer by Mehnaz13 Thursday, September 22, 2011 9:04 AM
    Saturday, September 17, 2011 10:17 AM