Re: Unprotect and Protect template when user enters a Formfield

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



It may just be phrasing. The macro may very well work, it is that it will
not run. It isn't triggered automatically.

That is what I meant when I said that you are going to have to do something
more elaborate.

By the way, what is the point of protection if you are going to unprotect
upon entry to a field? At that point the user can change anything in your
form.

Simple solution would be to display the forms toolbar and tell the user how
to protect/unprotect.

Otherwise, I think you get into displaying a userform that has formatting
options for the field. Upon closing that UserForm, you unprotect, apply the
formatting to the field, and reprotect.
http://word.mvps.org/FAQs/Userforms/CreateAUserForm.htm

For more about online forms, follow the links at
http://addbalance.com/word/wordwebresources.htm#Forms or
http://word.mvps.org/FAQs/Customization/FillinTheBlanks.htm especially Dian
Chapman's series of articles.

Hope this helps,
--

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:8136BF11-8FB9-42DC-A044-253A2F6B4427@xxxxxxxxxxxxxxxx
Hi Charles,

I know the Exit Macro doesn't work. Any idea what script to run after exit
the formfield description so the template is protected again.

Thanks!

KR

Frank

"Charles Kenyon" schreef:

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: Help with MVP spellcheck protected form code
    ... At the time the exit macro fires, the Selection is still in the formfield. ... doesn't stop after just that particular form field it keeps on going. ...
    (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: Problem running macro from QAT
    ... when triggered as an "on exit" from the formfield but not when triggered from ... the code works when I trigger it from within ... Text1 as a "run macro on exit". ...
    (microsoft.public.word.vba.general)
  • Re: calculate on exit/macro exit
    ... I can't see any good reason for an 'on exit' macro and 'calculate on exit' not to happily co-exist. ... In your original post you said "I also had an exit macro on one formfield to hide/unhide some text below the table depending upon ... Dim Toggle As Boolean ...
    (microsoft.public.word.vba.general)
  • Re: Insert New Row w/ Form Fields
    ... Have the following macro run on exit from the last formfield in the last row ... ' Macro created 02/02/03 by Doug Robbins ... Dim rownum As Integer, i As Integer ...
    (microsoft.public.word.vba.general)