I want to print Word documents with the help of the office.Interop.Word library.
So far I had no problems, but today i received a password protected file.
Now my application hangs on opening the word file.
How can I check if the file is password protected or is there a way to generate an exeption when the file is protected.
I use:
Microsoft.Office.Interop.Word.ApplicationClass myClass = new Microsoft.Office.Interop.Word.ApplicationClass();
Microsoft.Office.Interop.Word.Application myAppl = myClass.Application;
Microsoft.Office.Interop.Word.Document document = myAppl.Documents.OpenOld(ref filename, ref missingValue, ref missingValue, ref missingValue, ref missingValue, ref missingValue, ref missingValue, ref missingValue, ref missingValue, ref missingValue);
At the last (openold), my application hangs.
Or is there a way to generate a timeout for this ?
So far I had no problems, but today i received a password protected file.
Now my application hangs on opening the word file.
How can I check if the file is password protected or is there a way to generate an exeption when the file is protected.
I use:
Microsoft.Office.Interop.Word.ApplicationClass myClass = new Microsoft.Office.Interop.Word.ApplicationClass();
Microsoft.Office.Interop.Word.Application myAppl = myClass.Application;
Microsoft.Office.Interop.Word.Document document = myAppl.Documents.OpenOld(ref filename, ref missingValue, ref missingValue, ref missingValue, ref missingValue, ref missingValue, ref missingValue, ref missingValue, ref missingValue, ref missingValue);
At the last (openold), my application hangs.
Or is there a way to generate a timeout for this ?