officefileapi-devexpress-dot-xtrarichedit-dot-api-dot-native-d7218ac7.md
Base implementation of the DocumentEncryption interface.
Namespace : DevExpress.XtraRichEdit.API.Native
Assembly : DevExpress.RichEdit.v25.2.Core.dll
NuGet Package : DevExpress.RichEdit.Core
public class EncryptionSettings :
DocumentEncryption,
IDisposable
Public Class EncryptionSettings
Implements DocumentEncryption,
IDisposable
Use the EncryptionSettings class to password-protect the document on save, as shown below:
RichEditDocumentServer wordProcessor = new RichEditDocumentServer();
EncryptionSettings encryptionSettings = new EncryptionSettings();
encryptionSettings.Type = EncryptionType.Strong;
encryptionSettings.Password = "12345";
wordProcessor.SaveDocument("EncryptedWithNewPassword.docx", DocumentFormat.Docx, encryptionSettings);
Dim wordProcessor As New RichEditDocumentServer()
Dim encryptionSettings As New EncryptionSettings()
encryptionSettings.Type = EncryptionType.Strong
encryptionSettings.Password = "12345"
wordProcessor.SaveDocument("EncryptedWithNewPassword.docx", DocumentFormat.Docx, encryptionSettings)
Object EncryptionSettings
See Also