Unprotecting the document

P

piotr-unia

Hallo all,

The following problem has appeared in my word application.
I have created macro protecting document:

Sub pass()
ActiveDocument.Protect Password:="12345", NoReset:=False, Type:= _
wdAllowOnlyFormFields
End Sub

Unfortunately after protecting I cannot run macro to unprotect the
document. Is anybody experienced in this matter?
Thx in advance
Piotr
 
O

OTWarrior via OfficeKB.com

Try this:

If ActiveDocument.ProtectionType <> wdNoProtection Then
ActiveDocument.Unprotect Password:="12345"
End If
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top