PDA

View Full Version : How to hide macro code when using command button to unprotect



mela
05-21-2010, 10:49 AM
How to unprotect for tracked changes only
I posted in another thread but it didn't come across as a new question needing help. In another thread I found a good solution of writing a macro to unprotect a document, but want to make sure that the users cannot click on the command button to see the underlying code (where the actual password is). How to do this?

Also, does anyone have code that will not only unprotect the document, but ''re-protect'' it for tracked changes mode only? While I want to be client friendly and allow clients to make changes to terms, I also want the changes to be visible in tracked changes. Unfortunately, some clients have been known to sneak in changes and then sign the document without having us review their changes.

Since Word cannot allow two forms of a protection in a document, maybe there is code to allow this. Thank you.

fumei
05-21-2010, 11:16 AM
"Since Word cannot allow two forms of a protection in a document, maybe there is code to allow this"

Nope.
With ActiveDocument
.Unprotect "xxxxxxx"
.Protect (wdAllowOnlyRevisions)
End With
Unprotects the document, then protects it with revisions.