Thanks for your reply,
Ya i too know that MS-Word blocks the opened document.
If i'm trying to access the doc which is opened by MS-Word i was getting the error:
"The process cannot access the file 'd:\deleteMe\Test.doc' because it is being used by another process."
I'm not even able to access the doc. But my proble is different
The steps i have done are:
I created a doc with some data programatically
Then i opened the doc using MS-Word and did some modifications and closed the doc by saving the doc.
Now i'm able to programatically access the doc, as it is closed. But if i'm doing any modifications to the doc and saving the doc, then the exception is raised. And one more thing if i'm saving the doc with another file name then no issue, if i'm saving the doc with the same name, then the exception is raised.
Below is the code:
protected void Button3_Click(object sender, EventArgs e)
Document doc = new Document(@"d:\deleteMe\Test.doc");
NodeCollection runs = doc.GetChildNodes(NodeType.Run, true);
foreach(Run rn in runs)
rn.Font.Name = "Times New Roman";
rn.Font.Size = 12;
rn.Font.Bold = false;
rn.Font.Underline = Underline.None;
rn.Font.Color = System.Drawing.Color.Blue;
I was getting error on the lastline that is doc.Save, if i'm saving with another filename no issue, but if the same file name i am getting error.