Back to Devexpress

EncryptionSettings Class

officefileapi-devexpress-dot-xtrarichedit-dot-api-dot-native-d7218ac7.md

latest2.2 KB
Original Source

EncryptionSettings Class

Base implementation of the DocumentEncryption interface.

Namespace : DevExpress.XtraRichEdit.API.Native

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

NuGet Package : DevExpress.RichEdit.Core

Declaration

csharp
public class EncryptionSettings :
    DocumentEncryption,
    IDisposable
vb
Public Class EncryptionSettings
    Implements DocumentEncryption,
               IDisposable

Remarks

Use the EncryptionSettings class to password-protect the document on save, as shown below:

csharp
RichEditDocumentServer wordProcessor = new RichEditDocumentServer();
EncryptionSettings encryptionSettings = new EncryptionSettings();
encryptionSettings.Type = EncryptionType.Strong;
encryptionSettings.Password = "12345";

wordProcessor.SaveDocument("EncryptedWithNewPassword.docx", DocumentFormat.Docx, encryptionSettings);
vb
Dim wordProcessor As New RichEditDocumentServer()
Dim encryptionSettings As New EncryptionSettings()
encryptionSettings.Type = EncryptionType.Strong
encryptionSettings.Password = "12345"

wordProcessor.SaveDocument("EncryptedWithNewPassword.docx", DocumentFormat.Docx, encryptionSettings)

Implements

DocumentEncryption

IDisposable

Inheritance

Object EncryptionSettings

See Also

EncryptionSettings Members

How to: Open And Save Encrypted Files (GitHub)

DevExpress.XtraRichEdit.API.Native Namespace