Hi,
I am using Aspose.Words to read contents from word documents. I am using
below code to open the password protected documents using Aspose.words.
try
{
Document mainDoc = new Document(m_documentFile);
}
catch (Aspose.Words.IncorrectPasswordException)
{
LoadOptions loadOps = new LoadOptions();
loadOps.Password = "Test";
mainDoc = new Document(m_documentFile, loadOps);
}
But my current requirement is to loop the list of passwords provided by the user and try to open the document utile the document opens successfully.
Please provide the sample code for this as soon as possible.
Thanks,
Dhivya