Mailmerge into two different formats

R

robw

Hi,

Can anyone advise whether the following is possible :-

I'm using Word 2003 (and Excel 2003)

I'm wish to drive mailmerge from an excel "database" which has columns named
"type", "title", "description", "owner", "status"

I want the mailmerge to work as follows:-
If type is "1" then the other 4 fields are arranged in a small 2*2 table
with line borders
If type is "2" then the title alone is displayed (without any table or
borders)

Many thanks
Rob
 
P

Peter Jamieson

You should be able to do this using an IF field, e.g.
a. create your "type 1" table exactly how you want it, and put the
merge fields you want in the table
b. create an IF field (use ctrl-F9 to insert all the special field
code brace pairs):

{ IF "{ MERGEFIELD type }" = "1" "<your table>" "{ MERGEFIELD title }" }

or the following will probably be OK in this case:

{ IF { MERGEFIELD type } = 1 "<your table>" "{ MERGEFIELD title }" }


c. Use Edit->Copy and Edit->Paste to copy your table to yhe place
where I've put <your table>
d. delete the original table
e. test!

Of course, that assumes that any type other than 1 should result in the
title being displayed. If that's not the case you can nest IF fields or
use other approaches depending on exactly what you need.


Peter Jamieson

http://tips.pjmsn.me.uk
 
R

robw

Thanks Peter, I've tried that but couldn't get it to work.

(Obviously) I can get the straightforward "show A or show B depending on
the value of C" scenario to work correctly.

I can even get it to work as expected when the font size and colour of A is
different from those of B - which I found to be a pleasant surprise.

However , if A (or B) is a table, copied into place as you suggest, it
doesn't show at all for the relevant value of C. Even if the table is the
degenerate 1x1 case it doesn't work

Am I simply expecting too much?

Regards
Rob
 
D

Doug Robbins - Word MVP

Peter's suggestion works for me. With the field codes displayed in the
document, the field construction looks like the following where | represent
the vertical borders of the table cells:

{ IF { MERGEFIELD Type } = 1 "
| { MERGEFIELD Title } | { MERGEFIELD Description } |
| { MERGEFIELD Owner } | { MERGEFIELD Status } |
¶
" { MERGEFIELD Title } }

Note that there is a paragraph mark after the table that is included in the
quote marks surrounding the table.

--
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, originally posted via msnews.microsoft.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

Top