Re: Unprotect and Protect template when user enters a Formfield

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



An onexit macro is activated when the user leaves a formfield in a protected
form. Problem is, when you user exits, the form is not protected. You are
going to have to do something more elaborate.
--
Charles Kenyon

Word New User FAQ & Web Directory: http://addbalance.com/word

Intermediate User's Guide to Microsoft Word (supplemented version of
Microsoft's Legal Users' Guide) http://addbalance.com/usersguide

See also the MVP FAQ: http://word.mvps.org/FAQs/ which is awesome!

My criminal defense site: http://addbalance.com
--------- --------- --------- --------- --------- ---------
This message is posted to a newsgroup. Please post replies
and questions to the newsgroup so that others can learn
from my ignorance and your wisdom.


"Frank" <Frank@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:F26C73FE-8F15-4B80-927B-DD4820A519C0@xxxxxxxxxxxxxxxx
Hi All,

I ran into another 'problem' with a protected template. I want the
protection switched off when a users tabs to a formfield (in my example
Description) so the user can change the style and the font of this
Formfield.
After that, when he goes to the next formfield the protection should be
switched on again.
I have tried it with 2 macro's (and in the formfield switched the option
Run
Marco on Entry and Exit)

Macro 1= ActiveDocument.Unprotect Password:="password"

This works fine!

Marco 2 (on Exit)
ActiveDocument.Protect Type:=wdAllowOnlyFormFields, NoReset:=True_
Password = "password"

The second macro doesn't work anymore. So the protection stays off when
the
user leaves this Formfield. Can anyone help me with this?

Thanks in advance!

Kind regards,

Frank




.



Relevant Pages

  • Re: Need to copy row of a protected table
    ... If this macro is set to be run on exit from the last formfield in the row, ... ' Macro created 02/02/03 by Doug Robbins ... I created a button which turns the protection off, ...
    (microsoft.public.word.vba.general)
  • Re: Find average from multiple spots on doc
    ... Insert a Text Input formfield where you want the average to be displayed and set it to a Calculation Type formfield and then use the expression: ... Set ad = ActiveDocument ... Call pToggleProtectDoc ... ' this code toggles the form protection. ...
    (microsoft.public.word.vba.general)
  • Re: Unprotect and Protect template when user enters a Formfield
    ... I know the Exit Macro doesn't work. ... the formfield description so the template is protected again. ... "Charles Kenyon" schreef: ... when he goes to the next formfield the protection should be ...
    (microsoft.public.word.vba.general)
  • RE: spellcheck form macro with protection
    ... 'Check what type of protection - if any - has been applied ... 'User pressed Cancel button ... Dim FmFld As FormField, FmFldCount As Long, Pos As Long ... CorrectedError = MyRange.Text ...
    (microsoft.public.word.vba.general)
  • Re: Unprotect and Protect template when user enters a Formfield
    ... what is the point of protection if you are going to unprotect ... I know the Exit Macro doesn't work. ... the formfield description so the template is protected again. ...
    (microsoft.public.word.vba.general)