Protect Word Document



  1. Protect Word Document From Editing Mac
  2. Protect Word Document From Copying
  3. Protect Word Document Filling In Forms
  4. How To Password Protect A Word File
-->

Protect a document and mark the parts that can be changed On the Review tab, in the Protect group, click Restrict Editing. In the Editing restrictions area, select the Allow only this type of editing in the document check box. In the list of editing restrictions, click No changes (Read only). The type of protection to apply. 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. If supplied, the password to be able to edit the document, or to change or remove protection.

Helps to protect the specified document from changes. When a document is protected, users can make only limited changes, such as adding annotations, making revisions, or completing a form.

Protect word document for formProtect Word Document

Note If the document is already protected when you use this method, an error occurs.

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

expression Required. An expression that returns a Document object.

WdProtectionType

  • Step 1: Select the part of document you will protect, and then click the Rich Text Content Control button on the Developer tab. Note: Click to know how to add the Developer tab into the Ribbon: Show developer tab/ribbon in Word. Step 2: Go ahead to click the Properties.
  • Document.Protect method (Word); 2 minutes to read; o; O; k; J; S; In this article. Protects the specified document from unauthorized changes. Expression.Protect (Type, NoReset, Password, UseIRM, EnforceStyleLock) expression A variable that represents a Document object.
  • You can protect just parts of a document so that they cannot be changed. This is done by implementing Word's forms feature. With forms, you can choose the information to be entered in a specific area of the document, using special fields, and then protect the form to enforce the ability to only enter in those specific areas, while all other information is protected from being changed.
WdProtectionType can be one of these WdProtectionType constants.
wdAllowOnlyComments
wdAllowOnlyFormFields
wdAllowOnlyReading
wdAllowOnlyRevisions
wdNoProtection

NoReset Optional Variant. False to reset form fields to their default values. True to retain the current form field values if the specified document is protected. If Type isn't wdAllowOnlyFormFields, the NoReset argument is ignored.

Protect Word Document

Password Optional Variant. The password required to remove protection from the specified document. (See Remarks below.)

UseIRM Optional Variant. Specifies whether to use Information Rights Management (IRM) when protecting the document from changes.

Protect Word Document

Protect Word Document From Editing Mac

EnforceStyleLock Optional Variant. Specifies whether formatting restrictions are enforced in a protected document.

Remarks

Security 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. For recommended best practices on how to do this, see Security Notes for Microsoft Office Solution Developers.

Example

Protect Word Document From Copying

This example protects the active document for forms without resetting the contents of the form fields.

Protect Word Document Filling In Forms

This example protects Monthly Report.doc so that only comments can be added to it. The password is required to unprotect the document.

Applies to | Document Object

Protect Word Document

How To Password Protect A Word File

See Also | Protect Method | ProtectedForForms Property | ProtectionType Property | UnProtect Method