Re-Protecting a Password Protected Template

L

lotsof questions

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
 
C

Chad DeMeyer

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
 
L

lotsof questions

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


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


.
 
L

lotsof questions

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


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


.
.
 
C

Chad DeMeyer

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 said:
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


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


.
.
 
L

lotsof questions

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


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"
wrote in message
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


.

.


.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top