Back to Devexpress

RichEditDocumentImportOptions.EncryptionPassword Property

officefileapi-devexpress-dot-xtrarichedit-dot-import-dot-richeditdocumentimportoptions-e2d9de41.md

latest4.5 KB
Original Source

RichEditDocumentImportOptions.EncryptionPassword Property

Specifies a password used to unprotect a password-protected document during import.

Namespace : DevExpress.XtraRichEdit.Import

Assembly : DevExpress.RichEdit.v25.2.Core.dll

NuGet Package : DevExpress.RichEdit.Core

Declaration

csharp
public string EncryptionPassword { get; set; }
vb
Public Property EncryptionPassword As String

Property Value

TypeDescription
String

The target password.

|

Property Paths

You can access this nested property as listed below:

Object TypePath to EncryptionPassword
RichEditControlOptionsBase

.Import .EncryptionPassword

|

Remarks

The EncryptionPassword property specifies a password to open a password-encrypted document.
If the EncryptionPassword property is not specified or returns an invalid password, the EncryptedFilePasswordRequested event fires.

The code sample below shows how to specify the password to load an encrypted file.

csharp
server.Options.Import.EncryptionPassword = "test";
server.LoadDocument("Documents//testEncrypted.docx");
vb
server.Options.Import.EncryptionPassword = "test"
  server.LoadDocument("Documents//testEncrypted.docx")

The following code snippets (auto-collected from DevExpress Examples) contain references to the EncryptionPassword property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

winforms-richedit-document-encryption/CS/RichEditControl_Encryption/Form1.cs#L30

csharp
//Specify the password to load an encrypted file
    richEditControl1.Options.Import.EncryptionPassword = "test";
}

word-document-api-open-and-save-encrypted-files/CS/Program.cs#L23

csharp
server.Options.Import.EncryptionPassword = "test";
server.LoadDocument("Documents//testEncrypted.docx");

winforms-richedit-document-encryption/VB/RichEditControl_Encryption/Form1.vb#L26

vb
'Specify the password to load an encrypted file
    richEditControl1.Options.Import.EncryptionPassword = "test"
End Sub

word-document-api-open-and-save-encrypted-files/VB/Program.vb#L17

vb
AddHandler server.DecryptionFailed, AddressOf Server_DecryptionFailed
server.Options.Import.EncryptionPassword = "test"
server.LoadDocument("Documents//testEncrypted.docx")

See Also

EncryptedFilePasswordRequested

RichEditControl.EncryptedFilePasswordRequested (WinForms)

RichEditDocumentImportOptions Class

RichEditDocumentImportOptions Members

DevExpress.XtraRichEdit.Import Namespace