Thanks for your inquiry.
Aspose.Words provides the facility to open password protected Word files. The best way to check if a Microsoft Office Word file is password protected or not is to load the file using Aspose.Words normally and if you receive a Aspose.Words.IncorrectPasswordException then it is password protected file. As for other formats, such as Powerpoint & Excel, Aspose.Words only supports DOC, DOCX, RTF, HTML, OpenDocument, PDF, XPS and EPUB so you cannot use Aspose.Words to load and check Powerpoint or Excel documents. For Powerpoint you can look into Aspose.Slides and for Excel Aspose.Cells should be a good option to start with.
For checking Microsoft Word documents using Aspose.Words, following code snippet can help you:
String csInputFilePath = "complete uploaded file path";
#2B91AF">Document doc = new Document(csInputFilePath);<o:p></o:p>
catch (Aspose.Words.IncorrectPasswordException icPasswordException)<o:p></o:p>
MessageBox.Show(“Document is password protected, please make sure to provide password.”);<o:p></o:p>
Hope this helps. Please let us know if you need any further assistance.
I am not actually using Aspose Words library, and am looking for some code using Microsoft libraries.
Thank you for your interest in Aspose products. I would receommend you to use Powerful Aspose products for this purpose. As for the code using Microsoft liibraries go, you can ask the experts here
Hope this helps. Please let us know if you need more assistance, we will be glad to help you.