OdtSaveOptionsPassword Property

Gets or sets a password to encrypt document.

Namespace:  Aspose.Words.Saving
Assembly:  Aspose.Words (in Aspose.Words.dll) Version: 20.3
Syntax
public string Password { get; set; }

Property Value

Type: String
Remarks

In order to save document without encryption this property should be null or empty string.

Examples
Shows how to encrypted your odt/ott documents with a password.
Document doc = new Document(MyDir + "Document.docx");

OdtSaveOptions saveOptions = new OdtSaveOptions(saveFormat);
saveOptions.Password = "@sposeEncrypted_1145";

// Saving document using password property of OdtSaveOptions
doc.Save(ArtifactsDir + "OdtSaveOptions.Encrypt" +
         FileFormatUtil.SaveFormatToExtension(saveFormat), saveOptions);
See Also