WriteProtectionSetPassword Method |
Sets the write protection password for the document.
Namespace:
Aspose.Words.Settings
Assembly:
Aspose.Words (in Aspose.Words.dll) Version: 20.3
Syntaxpublic void SetPassword(
string password
)
Public Sub SetPassword (
password As String
)
public:
void SetPassword(
String^ password
)
member SetPassword :
password : string -> unit
Parameters
- password
- Type: SystemString
The password to set. Cannot be null, but can be an empty string.
RemarksIf a password is set, Microsoft Word will require the user to enter it or open
the document as read-only.
ExamplesSets the write protection password for the document.
Document doc = new Document();
doc.WriteProtection.SetPassword("pwd");
See Also