setPassword method

setPassword(password)

Sets the write protection password for the document.

setPassword(password: string)
ParameterTypeDescription
passwordstringThe 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.

See Also