Trying to use mail merge on a protected document

J

joey

Hello all, here is my problem. I have created a document
that i need to protect as a form. I also need to include
mail merge fields in it. I have sectioned my document, and
made sure to place the mail merge fields in the area that
is unprotected. However, when I enable protection on the
document, it disables my mail merge fields. is there any
way around this?
 
P

Peter Jamieson

Unfortunately Forms and merge don't work together anything like as well as
you might hope.

Are you trying to fill in the form, then merge the form "results" in some
way?

If so, you will probably need to use some VBA to unprotect the form, unlink
the form fields leaving their results, then perform the merge, e.g.
something along the general lines of:


With ActiveDocument
.Unprotect
.Sections(1).Range.Fields.Unlink
.MailMerge.Destination = wdSendToNewDocument
.MailMerge.Execute
End With

You can make a toolbar button or menu option to allow a user to execute this
code.
 
J

joey

hey, peter... thanks for the advice on this, i really
appreciate it. Actually, we were hoping that the mail
merge would run after the user first opened the form
(inputting stuff like student name, grade, etc.), and then
have the user enter the other info in the text fields as
they needed,for adding their notes without changing the
rest of the form. we're using a school program that has
student info, and is capable of importing data into forms
created by Word. While the protection is disabled, the
mail merge fields work fine, but the user can change the
rest of the document. When the protection is enabled, the
user can only type in the assigned text fields, but the
mail merge is disabled (on the toolbar, the mail merge
buttons are greyed out, and of course the mail merge
doesn't work). what i need is for the mail merge to work
without the user having to press a button to merge the
fields or protect the form themselves. I'll pass your
suggestion to my co-worker to see if we want to try this,
though. If you have any more suggestions, i'll definitely
appreciate them.
thanks again ! :)

Joey Hendon -> (e-mail address removed)12.al.us
Montgomery Public Schools
Montgomery,AL
 
P

Peter Jamieson

hey, peter... thanks for the advice on this, i really
appreciate it. Actually, we were hoping that the mail
merge would run after the user first opened the form
(inputting stuff like student name, grade, etc.), and then
have the user enter the other info in the text fields as
they needed,for adding their notes without changing the
rest of the form.

I'm guessing now as the sequence of events you describe isn't particularly
clear, but as far as I can tell you want

a. user opens word doc. containing form.
b. user fills in form fields and alters unprotcted text
c. some sort of mail merge runs

If so,
d. this is more or less the scenario described in my previous reply. But it
seems to me that the user has to be able to indicate in one way or another
that they have finished their selections and edits and want to do the merge.
It's mainly a question of how you want to let them indicate that.

What you actually /say/ suggests something more like

a. user opens word doc. containing form.
b. a mail merge runs
c. user enters values (where?)

in which case I'm wondering whether what you want to do is start with a form
document and generate multiple empty copies of it, each of which is filled
in by a different user. Or some such. In which case a different approach is
clearly required.
 

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