Back to Devexpress

EncryptionOptions Interface

officefileapi-devexpress-dot-spreadsheet-4c5864e0.md

latest2.3 KB
Original Source

EncryptionOptions Interface

Contains the workbook encryption options.

Namespace : DevExpress.Spreadsheet

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

NuGet Package : DevExpress.Spreadsheet.Core

Declaration

csharp
public interface EncryptionOptions
vb
Public Interface EncryptionOptions

The following members return EncryptionOptions objects:

Remarks

The EncryptionOptions class properties are used to specify the encryption type and a password for saving a workbook to a password encrypted file. An instance of this class is accessible using the SpreadsheetControl.Document.DocumentSettings.Encryption notation.

Example

This code snippet obtains the DocumentSettings.Encryption settings selected in the editors and prompts for saving a password encrypted file.

View Example

csharp
IWorkbook workbook = spreadsheetControl1.Document;
workbook.DocumentSettings.Encryption.Type = (EncryptionType)Enum.Parse(typeof(EncryptionType), barEncryptionTypeComboBox.EditValue.ToString());
workbook.DocumentSettings.Encryption.Password = barPasswordEdit.EditValue.ToString();
spreadsheetControl1.SaveDocumentAs();
vb
Dim workbook As IWorkbook = spreadsheetControl1.Document
workbook.DocumentSettings.Encryption.Type = DirectCast(System.Enum.Parse(GetType(EncryptionType), barEncryptionTypeComboBox.EditValue.ToString()), EncryptionType)
workbook.DocumentSettings.Encryption.Password = barPasswordEdit.EditValue.ToString()
spreadsheetControl1.SaveDocumentAs()

See Also

EncryptionOptions Members

DevExpress.Spreadsheet Namespace