I have following set of code in my program to set caption to word application and trying to close winword.exe process which is having same title.
Application wordApp=new Microsoft.Office.Interop.Word.Application()
wordApp.Visible = true;
wordApp.Application.Caption = "Test Document";
System.Diagnostics.Process[] aProcWrd = System.Diagnostics.Process.GetProcessesByName("WINWORD");
foreach (System.Diagnostics.Process oProc in aProcWrd)
{
if (oProc.MainWindowTitle=="Test Document")
oProc.Kill();
}
But Process.MainWindowTitle is always coming as empty.