Working With OOXML

Encrypt Document with Password

The OoXMLSaveOptions class provides an opportunity to save any document encrypted with the password. Using this class, the password can be set by using OoxmlSaveOptions.setPassword() property while saving the document. In order to save the document without encryption, this property should be set as null or an empty string. The given below code example shows how to set the password and save the document.

Setting the Compliance Level

Aspose.Words.Saving provides OoXMLCompliance enumeration which allows specifying which OOXML specification will be used when saving in the DOCX. This can be used with OoxmlSaveOptions.setCompliance() property. The given below code example shows how to set the compliance level while saving with OoxmlSaveOptions.

Update Last Saved Property

The OoXMLSaveOptions class provides an UpdateLastSaved property to gets or sets a value determining whether the LastSavedTime property is updated before saving. The given below code example shows how to set this property and save the document.

Keep Legacy Control Characters

Some formats support legacy control characters. Word does not save these symbols to DOCX format (more accurately in OOXML formats). Aspose.Words allows preserving the representation of legacy control characters while saving to OOXML format.  So far only one legacy character (ShortDateTime) is supported which declared in the “DOC” format. The given below code example shows how to preserve legacy control characters and save the document.