I have a form that I saved as a template, so that I can insert it into
various documents. I have written code that inserts this form using a macro
that does that and also opens a userform. The form has bookmarks and form
fields with options and drop downs that only work when the form is protected.
I need the form unprotected so that I can insert information from the
userform into specific bookmarks, but then need it protected after that, so
the form field options and drop downs will work. Is there code I can run in
the userform when the form is inserted that will unprotect it until the
infomation is sent to the bookmarks, and then code I can run to protect the
form so the form field options and drop down will work when I exit the
userform, or do I have to manually open the toolbars from the [View]
[Toolbars] [Forms] menu? Thanks!
--
Bill

Re: Protecting and unprotecting form fields by Doug

Doug
Sun Jan 15 23:22:54 CST 2006

You can use

[Document Object].Unprotect

[your code to insert into the bookmarks]

[Document Object].Protect wdAllowOnlyFormFields NoReset

where [Document Object] is a reference to the document.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

"Bill" <wmzeller@skaggs.net(donotspam)> wrote in message
news:6444D8DE-BE54-43BA-AE40-76CCAB974A61@microsoft.com...
>I have a form that I saved as a template, so that I can insert it into
> various documents. I have written code that inserts this form using a
> macro
> that does that and also opens a userform. The form has bookmarks and form
> fields with options and drop downs that only work when the form is
> protected.
> I need the form unprotected so that I can insert information from the
> userform into specific bookmarks, but then need it protected after that,
> so
> the form field options and drop downs will work. Is there code I can run
> in
> the userform when the form is inserted that will unprotect it until the
> infomation is sent to the bookmarks, and then code I can run to protect
> the
> form so the form field options and drop down will work when I exit the
> userform, or do I have to manually open the toolbars from the [View]
> [Toolbars] [Forms] menu? Thanks!
> --
> Bill



Re: Protecting and unprotecting form fields by wmzeller

wmzeller
Mon Jan 16 10:59:06 CST 2006

Thanks Doug. This did the trick!
--
Bill


"Doug Robbins - Word MVP" wrote:

> You can use
>
> [Document Object].Unprotect
>
> [your code to insert into the bookmarks]
>
> [Document Object].Protect wdAllowOnlyFormFields NoReset
>
> where [Document Object] is a reference to the document.
>
> --
> Hope this helps.
>
> Please reply to the newsgroup unless you wish to avail yourself of my
> services on a paid consulting basis.
>
> Doug Robbins - Word MVP
>
> "Bill" <wmzeller@skaggs.net(donotspam)> wrote in message
> news:6444D8DE-BE54-43BA-AE40-76CCAB974A61@microsoft.com...
> >I have a form that I saved as a template, so that I can insert it into
> > various documents. I have written code that inserts this form using a
> > macro
> > that does that and also opens a userform. The form has bookmarks and form
> > fields with options and drop downs that only work when the form is
> > protected.
> > I need the form unprotected so that I can insert information from the
> > userform into specific bookmarks, but then need it protected after that,
> > so
> > the form field options and drop downs will work. Is there code I can run
> > in
> > the userform when the form is inserted that will unprotect it until the
> > infomation is sent to the bookmarks, and then code I can run to protect
> > the
> > form so the form field options and drop down will work when I exit the
> > userform, or do I have to manually open the toolbars from the [View]
> > [Toolbars] [Forms] menu? Thanks!
> > --
> > Bill
>
>
>