T
ToddC
the following code to override the protect button protects a document
properly but renders a "runtime error 5485: The password is incorrect" when
trying to unprotect. Seems simple enough, but I'm not sure why this is
happening.
Sub toolsprotectdocument()
DocPass = "Password"
If ActiveDocument.ProtectionType = wdNoProtection Then
ActiveDocument.Protect Password:=DocPass, noReset:=True,
Type:=wdAllowOnlyFormFields
Else
Dialogs(wdDialogToolsUnprotectDocument).Show
End If
End Sub
properly but renders a "runtime error 5485: The password is incorrect" when
trying to unprotect. Seems simple enough, but I'm not sure why this is
happening.
Sub toolsprotectdocument()
DocPass = "Password"
If ActiveDocument.ProtectionType = wdNoProtection Then
ActiveDocument.Protect Password:=DocPass, noReset:=True,
Type:=wdAllowOnlyFormFields
Else
Dialogs(wdDialogToolsUnprotectDocument).Show
End If
End Sub