Hi Friends,
In my scenario am opening the WordDocument programatically,suppose if i'am opening the same worddocument i should prompt the message that the document is already opened ..
Process[] pro = Process.GetProcessesByName("WINWORD");
if (pro.Length > 0)
{
foreach (Process p in pro)
{
p.kill();
}
}
i'am using the above code to find the process and killing already opened documents, the problem is its killing the wordexe so that all the other opened documents also destroyed.. so how to find the name of the document and close particular documents only..
i used "P.MainWindowTitle" to get the opened document name but its not showing all the opened documents rather showing the first opened document name.
Please suggest me the solution ..
thanks in advance
Dev..