How to run Outlook using Process.Start(“outlook.exe”) and get the control back

前端 未结 5 803
难免孤独
难免孤独 2021-01-26 15:42

My C# program needs to launch Office Outlook and get the current \"running outlook application\". In order to do that I\'ve implemented the following simple program (so if you w

5条回答
  •  后悔当初
    2021-01-26 16:08

    Use the Process.Start overload that takes a ProcessStartInfo instead so you can set UseShellExecute

    var startInfo = new ProcessStartInfo()
    {
      FileName = "Outlook.exe",
      UseShellExecute = true
    };
    Process.Start(startInfo);
    

提交回复
热议问题