PDA

View Full Version : Solved: Word Document Protection



newk
02-25-2005, 08:44 AM
Hello,

I have a template with a userform. On the userform there are a few option buttons. Once an option button is selected it outputs some text into the footer.

I have now been asked to protect my document. I have therefore protected the top and bottom of my document using sections and left the middle open for people to type in. When the userform runs I get a compiler error because it's not allowed to output to the protected footer. Is there a way to bypass this so that VBA can write into the footer but not the user?

Any ideas would be gratefully received, thanks :))

newk
02-25-2005, 09:00 AM
Thanks Dreamboat

'In order to unprotect the form in Word 2000, you must use the following code before and after your procedure:

Before:

ActiveDocument.Unprotect Password:=""

After:

ActiveDocument.Protect Type:=wdAllowOnlyFormFields, NoReset:=True, Password:="" '

The office experts

Anne Troy
02-25-2005, 07:39 PM
Cool beans. :)