text in form fields disappears

D

Diana Morrison

I have a travel form that has a macrobutton. The user clicks it once for
each traveler - the macro unlocks the document, copies and pastes the travel
information table and locks the document. Each time, the text in the fields
disappears. Is there a way to stop this?
Thanks,
Diana
 
D

Dave Lett

Hi Diana,

When you "lock" the document, you're using the .Protect method. The .Protect
method has an optional NoReset parameter. Set that parameter to True.



HTH,
Dave
 
D

Diana Morrison

Actually this is what I'm using: ActiveDocument.Protect wdAllowOnlyFormFields
so I'm not sure what' you're telling me.
 
J

Jay Freedman

Please learn to use the VBA help. In this case, if you put the cursor on the
word Protect and press F1, you'll get the help topic for the Protect method,
and the example given there includes this:

ActiveDocument.Protect _
Type:=wdAllowOnlyFormFields, NoReset:=True

--
Regards,
Jay Freedman
Microsoft Word MVP
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.
 
D

Diana Morrison

unfortunately 'help' isnt' installed - I'll ask our IT dept...again.
Thanks for your help.
 
G

Greg Maxey

Diana,

At this point you don't really need Word Help. Jay provided the
answer. Use something like:

Sub Protect()
On Error GoTo Ignore
ActiveDocument.Protect Type:=wdAllowOnlyFormFields, NoReset:=True
Exit Sub
Ignore: Err.Clear
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