WriteProtectionSetPassword Method

Sets the write protection password for the document.

Namespace:  Aspose.Words.Settings
Assembly:  Aspose.Words (in Aspose.Words.dll) Version: 20.3
Syntax
public void SetPassword(
	string password
)

Parameters

password
Type: SystemString
The password to set. Cannot be null, but can be an empty string.
Remarks

If a password is set, Microsoft Word will require the user to enter it or open the document as read-only.

Examples
Sets the write protection password for the document.
Document doc = new Document();
doc.WriteProtection.SetPassword("pwd");
See Also