I have several form templates that need to be unprotected
and reprotected without losing the data typed into the
form fields...which can be found on the Microsoft
Knowledge Base.

The problem: when using the following, the template
reprotects itself, but does not apply the "password" to
protect the file. With all the code changes from 97 to
2000 software - is there something else that needs to be
added to get it to recognize the password? Assistance is
always appreciated....Best Regards

See below:

If ActiveDocument.ProtectionType = wdNoProtection Then
ActiveDocument.Protect Type:=wdAllowOnlyFormFields, _
NoReset:=True
Else
ActiveDocument.wdProtect Password:="my password"
End If

End Sub

Re: Re-Protecting a Password Protected Template by Chad

Chad
Tue Jun 29 18:35:55 CDT 2004

Replace your code with (interpret as one line regardless of how your
newsgroup interface wraps the text):

If ActiveDocument.ProtectionType = wdnoProtection Then
ActiveDocument.Protect Type:=wdAllowOnlyFormFields, NoReset:=True,
Password:= "[your password here]"

Regards,
Chad DeMeyer


"lotsof questions" <anonymous@discussions.microsoft.com> wrote in message
news:230df01c45e2f$0bb39990$a301280a@phx.gbl...
> I have several form templates that need to be unprotected
> and reprotected without losing the data typed into the
> form fields...which can be found on the Microsoft
> Knowledge Base.
>
> The problem: when using the following, the template
> reprotects itself, but does not apply the "password" to
> protect the file. With all the code changes from 97 to
> 2000 software - is there something else that needs to be
> added to get it to recognize the password? Assistance is
> always appreciated....Best Regards
>
> See below:
>
> If ActiveDocument.ProtectionType = wdNoProtection Then
> ActiveDocument.Protect Type:=wdAllowOnlyFormFields, _
> NoReset:=True
> Else
> ActiveDocument.wdProtect Password:="my password"
> End If
>
> End Sub



Re: Re-Protecting a Password Protected Template by lotsof

lotsof
Wed Jun 30 09:41:29 CDT 2004

Chad: My thanks for your help - my headache just went
away! The "code changes" from 97 to 2000 are sometimes
subtle and always aggravating!
>-----Original Message-----
>Replace your code with (interpret as one line regardless
of how your
>newsgroup interface wraps the text):
>
>If ActiveDocument.ProtectionType = wdnoProtection Then
>ActiveDocument.Protect Type:=wdAllowOnlyFormFields,
NoReset:=True,
>Password:= "[your password here]"
>
>Regards,
>Chad DeMeyer
>
>
>"lotsof questions" <anonymous@discussions.microsoft.com>
wrote in message
>news:230df01c45e2f$0bb39990$a301280a@phx.gbl...
>> I have several form templates that need to be
unprotected
>> and reprotected without losing the data typed into the
>> form fields...which can be found on the Microsoft
>> Knowledge Base.
>>
>> The problem: when using the following, the template
>> reprotects itself, but does not apply the "password" to
>> protect the file. With all the code changes from 97 to
>> 2000 software - is there something else that needs to be
>> added to get it to recognize the password? Assistance
is
>> always appreciated....Best Regards
>>
>> See below:
>>
>> If ActiveDocument.ProtectionType = wdNoProtection Then
>> ActiveDocument.Protect
Type:=wdAllowOnlyFormFields, _
>> NoReset:=True
>> Else
>> ActiveDocument.wdProtect Password:="my password"
>> End If
>>
>> End Sub
>
>
>.
>

Re: Re-Protecting a Password Protected Template by lotsof

lotsof
Wed Jun 30 09:58:19 CDT 2004

Chad: More questions- in the example you responded to
below, the form template in question is being unlocked to
allow for a mail merge. It should then be "automatically"
locked down. Is there a way that it can be relocked while
the mail merge is taking place? A sub routine? and how (my
knowledge is zilch here). Can I pass on a "lockdown"
feature for the newly created mail merged document? Best
Regards
>-----Original Message-----
>Chad: My thanks for your help - my headache just went
>away! The "code changes" from 97 to 2000 are sometimes
>subtle and always aggravating!
>>-----Original Message-----
>>Replace your code with (interpret as one line regardless
>of how your
>>newsgroup interface wraps the text):
>>
>>If ActiveDocument.ProtectionType = wdnoProtection Then
>>ActiveDocument.Protect Type:=wdAllowOnlyFormFields,
>NoReset:=True,
>>Password:= "[your password here]"
>>
>>Regards,
>>Chad DeMeyer
>>
>>
>>"lotsof questions" <anonymous@discussions.microsoft.com>
>wrote in message
>>news:230df01c45e2f$0bb39990$a301280a@phx.gbl...
>>> I have several form templates that need to be
>unprotected
>>> and reprotected without losing the data typed into the
>>> form fields...which can be found on the Microsoft
>>> Knowledge Base.
>>>
>>> The problem: when using the following, the template
>>> reprotects itself, but does not apply the "password" to
>>> protect the file. With all the code changes from 97 to
>>> 2000 software - is there something else that needs to
be
>>> added to get it to recognize the password? Assistance
>is
>>> always appreciated....Best Regards
>>>
>>> See below:
>>>
>>> If ActiveDocument.ProtectionType = wdNoProtection Then
>>> ActiveDocument.Protect
>Type:=wdAllowOnlyFormFields, _
>>> NoReset:=True
>>> Else
>>> ActiveDocument.wdProtect Password:="my password"
>>> End If
>>>
>>> End Sub
>>
>>
>>.
>>
>.
>

Re: Re-Protecting a Password Protected Template by Chad

Chad
Thu Jul 01 18:16:05 CDT 2004

In answer to your first question, the way I usually give users a
functionality that forms protection disables is with something like this,
for instance:

Sub FilePageSetup
ActiveDocument.Unprotect Password:=XXX
Dialogs(wdDialogFilePageSetup).Show
ActiveDocument.Protect ProtectionType:=wdAllowOnlyFormFields,
NoReset:=True, Password:=XXX
End Sub

and then give the user a menu or toolbar shortcut to run it.

I don't think I can answer your second question because mail merge is one of
those few functions in Word that I haven't needed to use much, so I don't
know any of the objects, properties, or methods involved in working with
that functionality through VBA. I'm sure one of the great gurus who monitor
this newsgroup can answer your question in my place.

Regards,
Chad DeMeyer


"lotsof questions" <anonymous@discussions.microsoft.com> wrote in message
news:233bb01c45eb2$ae3253e0$a601280a@phx.gbl...
> Chad: More questions- in the example you responded to
> below, the form template in question is being unlocked to
> allow for a mail merge. It should then be "automatically"
> locked down. Is there a way that it can be relocked while
> the mail merge is taking place? A sub routine? and how (my
> knowledge is zilch here). Can I pass on a "lockdown"
> feature for the newly created mail merged document? Best
> Regards
> >-----Original Message-----
> >Chad: My thanks for your help - my headache just went
> >away! The "code changes" from 97 to 2000 are sometimes
> >subtle and always aggravating!
> >>-----Original Message-----
> >>Replace your code with (interpret as one line regardless
> >of how your
> >>newsgroup interface wraps the text):
> >>
> >>If ActiveDocument.ProtectionType = wdnoProtection Then
> >>ActiveDocument.Protect Type:=wdAllowOnlyFormFields,
> >NoReset:=True,
> >>Password:= "[your password here]"
> >>
> >>Regards,
> >>Chad DeMeyer
> >>
> >>
> >>"lotsof questions" <anonymous@discussions.microsoft.com>
> >wrote in message
> >>news:230df01c45e2f$0bb39990$a301280a@phx.gbl...
> >>> I have several form templates that need to be
> >unprotected
> >>> and reprotected without losing the data typed into the
> >>> form fields...which can be found on the Microsoft
> >>> Knowledge Base.
> >>>
> >>> The problem: when using the following, the template
> >>> reprotects itself, but does not apply the "password" to
> >>> protect the file. With all the code changes from 97 to
> >>> 2000 software - is there something else that needs to
> be
> >>> added to get it to recognize the password? Assistance
> >is
> >>> always appreciated....Best Regards
> >>>
> >>> See below:
> >>>
> >>> If ActiveDocument.ProtectionType = wdNoProtection Then
> >>> ActiveDocument.Protect
> >Type:=wdAllowOnlyFormFields, _
> >>> NoReset:=True
> >>> Else
> >>> ActiveDocument.wdProtect Password:="my password"
> >>> End If
> >>>
> >>> End Sub
> >>
> >>
> >>.
> >>
> >.
> >



Re: Re-Protecting a Password Protected Template by lotsof

lotsof
Fri Jul 02 09:43:00 CDT 2004

Chad - again my thanks for your taking the time to respond.

Best Regards

>-----Original Message-----
>In answer to your first question, the way I usually give
users a
>functionality that forms protection disables is with
something like this,
>for instance:
>
>Sub FilePageSetup
> ActiveDocument.Unprotect Password:=XXX
> Dialogs(wdDialogFilePageSetup).Show
> ActiveDocument.Protect
ProtectionType:=wdAllowOnlyFormFields,
>NoReset:=True, Password:=XXX
>End Sub
>
>and then give the user a menu or toolbar shortcut to run
it.
>
>I don't think I can answer your second question because
mail merge is one of
>those few functions in Word that I haven't needed to use
much, so I don't
>know any of the objects, properties, or methods involved
in working with
>that functionality through VBA. I'm sure one of the
great gurus who monitor
>this newsgroup can answer your question in my place.
>
>Regards,
>Chad DeMeyer
>
>
>"lotsof questions" <anonymous@discussions.microsoft.com>
wrote in message
>news:233bb01c45eb2$ae3253e0$a601280a@phx.gbl...
>> Chad: More questions- in the example you responded to
>> below, the form template in question is being unlocked
to
>> allow for a mail merge. It should then
be "automatically"
>> locked down. Is there a way that it can be relocked
while
>> the mail merge is taking place? A sub routine? and how
(my
>> knowledge is zilch here). Can I pass on a "lockdown"
>> feature for the newly created mail merged document?
Best
>> Regards
>> >-----Original Message-----
>> >Chad: My thanks for your help - my headache just went
>> >away! The "code changes" from 97 to 2000 are sometimes
>> >subtle and always aggravating!
>> >>-----Original Message-----
>> >>Replace your code with (interpret as one line
regardless
>> >of how your
>> >>newsgroup interface wraps the text):
>> >>
>> >>If ActiveDocument.ProtectionType = wdnoProtection Then
>> >>ActiveDocument.Protect Type:=wdAllowOnlyFormFields,
>> >NoReset:=True,
>> >>Password:= "[your password here]"
>> >>
>> >>Regards,
>> >>Chad DeMeyer
>> >>
>> >>
>> >>"lotsof questions"
<anonymous@discussions.microsoft.com>
>> >wrote in message
>> >>news:230df01c45e2f$0bb39990$a301280a@phx.gbl...
>> >>> I have several form templates that need to be
>> >unprotected
>> >>> and reprotected without losing the data typed into
the
>> >>> form fields...which can be found on the Microsoft
>> >>> Knowledge Base.
>> >>>
>> >>> The problem: when using the following, the template
>> >>> reprotects itself, but does not apply
the "password" to
>> >>> protect the file. With all the code changes from
97 to
>> >>> 2000 software - is there something else that needs
to
>> be
>> >>> added to get it to recognize the password?
Assistance
>> >is
>> >>> always appreciated....Best Regards
>> >>>
>> >>> See below:
>> >>>
>> >>> If ActiveDocument.ProtectionType = wdNoProtection
Then
>> >>> ActiveDocument.Protect
>> >Type:=wdAllowOnlyFormFields, _
>> >>> NoReset:=True
>> >>> Else
>> >>> ActiveDocument.wdProtect Password:="my
password"
>> >>> End If
>> >>>
>> >>> End Sub
>> >>
>> >>
>> >>.
>> >>
>> >.
>> >
>
>
>.
>