How do I put a word at the end of a mail merge field?

K

kandy1216

I have a word document that I want to use with excel in a mail merge.

In one of the columns, I want to have the word years after the number data
is put in the table, ie. 6 yrs. How do I set up the mail merge excel
document so that yrs. will print after each number? Someone thought I should
use a comma after the mail merge field but then the comma showed up with the
word years. If I put yrs. in each row after the field, then yrs. shows up
when there is no record in that particular row.

Hope you can understand what I am trying to say! Thanks for any help.
 
D

Doug Robbins - Word MVP

You need to use an If...then...Else field construction in Word, something
like

{ IF { MERGEFIELD Age } <> "" "{ MERGEFIELD Age } yrs" "" }

You must use Ctrl+F9 to insert each pair of the field delimiters { } and you
use Alt+F9 to toggle off their display.

You can of course do a similar thing in the Excel data source by creating
another field that uses the formula

= IF( cellcontainingage <> "", = cellcontainingage & " yrs", "")

Note that in Excel there is a comma separating each part of the
If...then...Else construction wherease in Word, just a space is used.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 
M

macropod

Hi Kandy,

To do this:
.. select your «Age» mergefield and press Ctrl-F9 to wrap a new field around it, thus:
{ «Age» }
.. type '=' and '\# "0yrs;;"' in the new field, thus:
{=«Age» \# "0yrs;;"}
.. press F9 to update the field
.. run your mailmerge

Cheers
 

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