C
Chuck Norris
Hi everybody,
A question about how to use 'Microsoft.Office.Interop.Word'.
I'm trying the following code:
Application app = new Word.ApplicationClass();
Document doc = app.Documents.Open(ref templateFile,...);
//...
//replace bookmarks...
//...
doc.SaveAs(ref newFile,...);
doc.Close(...);
doc.Quit(...);
It works very well but when the templateFile is already opened in
another Word instance,
the following dialog box appears in my .NET app.:
If few word the box says:
"File already in use", the templateFile is blocked.
Then 3 radiobuttons to make a choice:
- open a read-only copy
- create a local copy
- wait until the file is ready
Now I don't want this dialog box to appear, I want my app to work even
if the templateFile is already opened,
because the template remains unchanged in any case and the app always
saves a copy of it.
Someone can help me!
Thanks,
Bye.
A question about how to use 'Microsoft.Office.Interop.Word'.
I'm trying the following code:
Application app = new Word.ApplicationClass();
Document doc = app.Documents.Open(ref templateFile,...);
//...
//replace bookmarks...
//...
doc.SaveAs(ref newFile,...);
doc.Close(...);
doc.Quit(...);
It works very well but when the templateFile is already opened in
another Word instance,
the following dialog box appears in my .NET app.:
If few word the box says:
"File already in use", the templateFile is blocked.
Then 3 radiobuttons to make a choice:
- open a read-only copy
- create a local copy
- wait until the file is ready
Now I don't want this dialog box to appear, I want my app to work even
if the templateFile is already opened,
because the template remains unchanged in any case and the app always
saves a copy of it.
Someone can help me!
Thanks,
Bye.