How to find password protected office documents

How to identify (programmatically, .Net) if an office document (word, excel, access, powerpoint, ..) is  password protected?
Who is Participating?
eguilhermeConnect With a Mentor Commented:
since they are all proprietary formats, you will need to use the interop class available, and since there is no "generic" interop that works for all office documents, im afraid that your best if not only choice, is to manually open using the correct interop class for each type of document.

If you have the option for 3rd party tools and such, you may want to check this one:

im not sure if they support password checking and such, but at least you wont need interop with those :)
VN2008Author Commented:
Thank you for feedback! Some of the links are known to me. So we must open the docs programmatically  (each format with help of the corresponding class) and must check the property HasPassword.
Is this the only effective way ?
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.