WriteProtection Class
Represents the write protection options for the DocumentModel. Supported only in DOCX and DOC formats.
- Inheritance:
- System.ObjectWriteProtection
Remarks
Write protection refers to a mode in which the document's contents can be edited but the document cannot be resaved using the same file name.
For more information, see DOCX Write Protection example.
Constructors
WriteProtection()
Initializes a new instance of the WriteProtection class.
Properties
HasPassword
Returns true if DocumentModel is protected with the password against re-saving to the same file name.
Property Value
- System.Boolean
true if DocumentModel is protected with the password against re-saving to the same file name; otherwise, false.
ReadOnlyRecommended
Gets or sets option that specifies if applications should provide user interface recommending that the user open this document in write protected state.
Property Value
- System.Boolean
true if applications should provide user interface recommending that the user open this document in write protected state; otherwise, false.
Remarks
User interface recommending that the user open this document in write protected state is only presented if password is not specified.
Methods
Clone()
Clones this WriteProtection instance.
Returns
Cloned WriteProtection.
SetPassword(String)
Sets the write protection password for the current DocumentModel instance.
Parameters
password
- System.String
New write protection password (or null to remove password from write protection).
Remarks
Password is optional for write protection, but without it any user will be able to open the document as not read-only and thus be able to resave the document using the same file name.