ProtectedViewWindow.Edit method (Word)

Syntax

expression.Edit (PasswordTemplate, WritePasswordDocument, WritePasswordTemplate)

expression An expression that returns a ProtectedViewWindow object.

Parameters

Name Required/Optional Data type Description
PasswordTemplate Optional Variant The password for opening the template.
WritePasswordDocument Optional Variant The password for saving changes to the document.
WritePasswordTemplate Optional Variant The password for saving changes to the template.

Return value

Document

Remarks

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.

Example

The following code example opens (for editing) the document associated with the active Protected View window.

Dim pvDoc As Document 
 
Set pvDoc = ActiveProtectedViewWindow.Edit

See also

ProtectedViewWindow Object

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.