Document.Protect method (Word)

Protects the specified document from unauthorized changes.

Syntax

expression.Protect (Type, NoReset, Password, UseIRM, EnforceStyleLock)

expression A variable that represents a Document object.

Parameters

Name Required/Optional Data type Description
Type Required WdProtectionType The type of protection to apply.
NoReset Optional Variant False to reset form fields to their default values; True to retain the current form field values if the document is protected. If Type is not wdAllowOnlyFormFields, NoReset is ignored.
Password Optional Variant If supplied, the password to be able to edit the document, or to change or remove protection.
UseIRM Optional Variant Specifies whether to use Information Rights Management (IRM) when protecting the document from changes.
EnforceStyleLock Optional Variant Specifies whether formatting restrictions are enforced for a protected document.
Type Required WDPROTECTIONTYPE
NoReset Optional Variant
Password Optional Variant
UseIRM Optional Variant
EnforceStyleLock Optional Variant

Return value

VOID

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.