Well, I'm going to try divining the solution with my crystal ball because of yourvaguely-worded non-question.
Your method to close Outlook should look more like this:
private static void CloseOutlook()
{
Process[] outlooks = Process.GetProcessesByName("OUTLOOK");
foreach (Process outlook in outlooks)
{
int id = outlook.Id;
outlook.Kill();
Process proc = null;
do
{
proc = Process.GetProcessById(id);
if (proc != null)
{
Thread.Sleep(250);
}
} while (proc <> null);
}
}
To restart outlook, you need to find the executable on the system, and execute it. Look for the appropriate registry entry to find the install location, and use the
Process
class to start it.