WritePassword Property

Microsoft Word Visual Basic

WritePassword Property

       

Sets a password for saving changes to the specified document. Write-only String.

Example

If the active document isn't already protected against saving changes, this example sets "secret" as the write password for the document.

Set myDoc = ActiveDocument
If myDoc.WriteReserved = False Then myDoc.WritePassword = "secret"