K
kill_beast
So I have a Word document with Form Field protection. It has code for both
Document_Close and Document_Open.
Both use this to turn off and turn back on the protection:
If ActiveDocument.ProtectionType <> wdNoProtection Then
ActiveDocument.Unprotect Password:="<password>"
End If
....and then...
ActiveDocument.Protect Type:=wdAllowOnlyFormFields, NoReset:=True,
Password:="<password>"
In between these statements, I have some code that attempts to change the
font of some form fields, but for some reason, the Document_Open sub
procedure doesn't work, specifically because it says that form protection is
on. Basically, my Unprotect section isn't working on Document_Open. It
does, however, work fine on my Document_Close.
What could be the reason for this? I check the passwords to make sure I
hadn't fat fingered something, and I haven't.
Any ideas?
Thanks!
Document_Close and Document_Open.
Both use this to turn off and turn back on the protection:
If ActiveDocument.ProtectionType <> wdNoProtection Then
ActiveDocument.Unprotect Password:="<password>"
End If
....and then...
ActiveDocument.Protect Type:=wdAllowOnlyFormFields, NoReset:=True,
Password:="<password>"
In between these statements, I have some code that attempts to change the
font of some form fields, but for some reason, the Document_Open sub
procedure doesn't work, specifically because it says that form protection is
on. Basically, my Unprotect section isn't working on Document_Open. It
does, however, work fine on my Document_Close.
What could be the reason for this? I check the passwords to make sure I
hadn't fat fingered something, and I haven't.
Any ideas?
Thanks!