IncorrectPasswordException Class

Wordize.IncorrectPasswordException class. Thrown if a document is encrypted with a password and the password specified when opening the document is incorrect or missing.

IncorrectPasswordException class

Thrown if a document is encrypted with a password and the password specified when opening the document is incorrect or missing.

public class IncorrectPasswordException : Exception

Examples

Shows how to catch incorrect password exception upon convert password encrypted document.

LoadOptions loadOptions = new LoadOptions();
loadOptions.Password = "incorrect_passsword";

try
{
    Converter.Create()
        .From(MyDir + "SimpleEncrypted.docx", loadOptions)
        .To(ArtifactsDir + "LoadOptions.Password.pdf")
        .Execute();
}
catch (IncorrectPasswordException)
{
    Console.WriteLine("The specified password to decrypt the document is incorrect.");
}

See Also