ProtectedViewWindow.Edit (Word)

expression.Edit (PasswordTemplate, WritePasswordDocument, WritePasswordTemplate)

Avoid using hard-coded passwords in your applications. If a password is required in a procedure, request the password from the user, store it in a variable, and then use the variable in your code.

Edit (PasswordTemplate, WritePasswordDocument, WritePasswordTemplate)

Dim pvDoc As Document 
Set pvDoc = ActiveProtectedViewWindow.Edit


Optional arguments

The following arguments are optional

PasswordTemplate (Template) - The password for opening the template.

WritePasswordDocument (String) - The password for saving changes to the document.

WritePasswordTemplate (Template) - The password for saving changes to the template.