var p = Process.GetProcessesByName("WINWORD"); if (p.Any()) { for (int i = 0; i < p.Length; i++) { p[i].Kill(); } } p = Process.GetProcessesByName("EX ...
var p = Process.GetProcessesByName("WINWORD");
if (p.Any())
{
for (int i = 0; i < p.Length; i++)
{
p[i].Kill();
...