detect if doc is protected

D

Daniel

Good afternoon,

I need to know how I can determine if a document is protected or not using
an if/else statement so I can then unprotect it if it was protected.

Thank you,

Daniel
 
H

Helmut Weber

Hi Daniel,

If ActiveDocument.ProtectionType <> wdNoProtection Then
ActiveDocument.Unprotect
End If

or, if there is a password

If ActiveDocument.ProtectionType <> wdNoProtection Then
ActiveDocument.Unprotect Password:=strPassword '!
End If

Greetings from Bavaria, Germany

Helmut Weber, MVP, WordVBA

Win XP, Office 2003
"red.sys" & Chr$(64) & "t-online.de"
 

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