Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Losing Data in Protected Forms

Status
Not open for further replies.

bnc123

Technical User
Mar 25, 2001
59
AU
I have created a form in Word XP with some text fields and some check boxes etc. Now, I can only operate the document as a form after protecting it for forms.

Say for some reason, after filling in part of the data, I need to unprotect the form. When I re-protect it, I lose all the data that is already filled-in (all fields become blank).

Is there any way of keeping the data intact if I have to unprotect the document and re-protect it?
 
You'll need a macro to do that:

Sub ReprotectFields()

If ActiveDocument.ProtectionType = wdNoProtection Then
ActiveDocument.Protect Type:=wdAllowOnlyFormFields, _
NoReset:=True
End If

End Sub

Assign a shortcut for ease of use.

Ilse
 
OK I have created the macro. When do I use it? After entering every field or just before re-protecting the document? I have tried it in a few different ways and it does not work.

Can you please give me some detailed instructions? Thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top