Can I create logic to include/omit sections of text?

D

D. Wentzler

Is it possible to create a mail merge letter that inserts/omits sections of
formatted text (including tables or charts) based on indicators in my data
source? Each section would also contain data fields to be populated from the
source data. Could the "inserts" be pulled from a separate Word file in to
the merge document? Thanks!
 
H

Heather

Is it possible to create a mail merge letter that inserts/omits sections of
formatted text (including tables or charts) based on indicators in my data
source? Each section would also contain data fields to be populated from the
source data. Could the "inserts" be pulled from a separate Word file in to
the merge document? Thanks!

I've been working on something similar for a gigantic mail merge. Part
of the data I'm using is pulling data from a csv file, and some of what
I'm doing is inserting text from a separate word file based on the data
in the merge.

{if {mergefield admittype}="HS" {includetext c:\\frosh1.doc
bookmark_frosh_1} ""}

So there - if the merge field from my csv file is equal to "HS", I'm
telling word to include the text in file frosh1.doc. Graham Mayer saved
my butt this morning by telling me to include a bookmark in the
frosh1.doc (I selected the text up to the paragraph mark and then
bookmarked it) so that the line in my letter doesn't break. The double
quotation marks tell the merge that if the 'admittype' field isn't HS,
leave blank (no data inserted).

Something I was fiddling around with today for the addresses:

{if {mergefield "Line4"}="Canada" "" {Mergefield "Line4"}}

That statement is saying if the merge field Line4 in my csv file says
Canada, don't add it. Otherwise, merge the data in. The letters I'll be
merging are being sent from a Canadian address, so we only need to put
the country if they're going elsewhere.

Hope that helps. The google groups here are pretty amazing...I don't
know what I'd do without them!!

Heather
 

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