Word Form Fields in a Mail Merge Document


Ralph Eric

I have created a mail merged Word Document containing Form Field Drop Down
boxes and Check boxes. It won't work with the Mail Merge in Salesforce unless
I upload it with Protection off, which means the drop down and checkboxes
don't work until the Protection button is turned back on.
Is there a way to have Protection automatically engage after the Mail Merge
is complete? This would save me from having to have all my users add the Form
Field tool bar to their Word application and trained to click the lock icon
before completing the document.
Thanks in advance.
Ralph Eric

Ralph Eric

Really appreciate the reply.
Actually, I already have the mail merge document so it loads the data
correctly. All I'm looking for is a macro that will simply toggle the
protection "On" after the form is opened in Word and the fields are
populated, so the drop down and checkbox form fields are engaged.
I was hoping a script could be embedded that would trigger once the fields
finish populating.
Ralph Eric

Graham Mayor

The reason that Doug and I made the linked page available was to overcome
exactly the problems you are encountering.

You can only lock the form automatically if you create a macro to run your
merge process and lock the form from that macro before saving it, which is
essentially what the page demonstrates. You cannot merge the macro code that
would allow your users to open the document with the form locked.

The page I referred you to has example code showing how to lock the form

'Protect the document for forms
ActiveDocument.Protect _
Type:=wdAllowOnlyFormFields, _
NoReset:=True, Password:=sPassword
'and save it
ActiveDocument.SaveAs FileName:=DocName, _
FileFormat:=wdFormatDocument, _

sPassword and DocName are variables defined earlier in the macro.

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>

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