Protect Method Example

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

If ActiveDocument.ProtectionType = wdNoProtection Then
    ActiveDocument.Protect _
        Type:=wdAllowOnlyFormFields, NoReset:=True
End If

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

Set myDoc = Documents("Monthly Report.doc")
myDoc.Protect Type:=wdAllowOnlyComments, Password:="free"