This is my code:
NullObject = System.Reflection.Missing.Value;
DocFile = docFile.FileInfo.FullName;
ReadOnly = true;
IsVisible = false;
WordApp = new Word.ApplicationClass();
WordDoc = WordApp.Documents.Open(ref DocFile, ref NullObject, ref ReadOnly,
ref NullObject,
ref NullObject, ref NullObject, ref NullObject, ref NullObject, ref
NullObject, ref NullObject,
ref NullObject, ref IsVisible, ref NullObject, ref NullObject, ref
NullObject);
When the "Open" method is executed and the .doc file has password the word
application has opened and ask for the password.
I need to know if thie doc has password before execute the "Open".
Is there any way?
Thanks!
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> escribió
en el mensaje news:ef**************@TK2MSFTNGP10.phx.gbl...
Kevin,
When you load the document, you should be able to check the HasPassword
property to determine if it has a password or not.
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com
"Kevin" <@> wrote in message news:u$**************@TK2MSFTNGP09.phx.gbl... Hi!
How to know if a .doc file has password?
Thanks!