O
OTWarrior via OfficeKB.com
I have a document that is protected so the user cannot enter information in
any place i don't want them to. When the form is saved, I have a macro to
input a unique reference in a text box (which unprotects the document and
protects it again, obviously)
The problem is I need to save the fomr for use, without running the macro. If
I unprotect the document and save, it should protect the document on save
anyway. However, I am not sure how to test that a document is protected, so
cannot test for a null value of it.
Long story short, how do I test that a document is protected?
NB: I did try the following, but to no avail.
If ActiveDocument.Protect = True Then
ActiveDocument.Unprotect Password:="password"
Else
Exit Sub
any place i don't want them to. When the form is saved, I have a macro to
input a unique reference in a text box (which unprotects the document and
protects it again, obviously)
The problem is I need to save the fomr for use, without running the macro. If
I unprotect the document and save, it should protect the document on save
anyway. However, I am not sure how to test that a document is protected, so
cannot test for a null value of it.
Long story short, how do I test that a document is protected?
NB: I did try the following, but to no avail.
If ActiveDocument.Protect = True Then
ActiveDocument.Unprotect Password:="password"
Else
Exit Sub