Mailmerge fields WITHIN the text of IF-then-else

R

Retread

First, thanks to Doug MVP and "Ed" for previous comments regarding MM.
Reading them almost got me the whole way through my "problem". Using "Ed's"
suggestion from 4/5/2007, I tried to test one field three times :
if it's an "M" text should say "in memory of firstname lastname
(mergefields) then another sentence re: sending an acknowlegement,
if an "H", "in honor of firstname lastname, etc.
If blank, then put a period at the end of the preceding sentence.

I'm pretty new to this, and can't even figure out how to copy my actual code
into this question - ctl F9 doesn't work within this question box and doing
Edit, Copy, then Edit, Paste doesn't work either.
From the code I wrote by nesting Ed's statement (see above) here is what I
get :

in memory of . An acknowledgement will be sent as you requested.

MERGEFIELD FIRSTNAME MERGEFIELD LASTNAME fields (both bracketed by using Ctl
F9) don't show up after "in memory of".

I'm pretty new to this, and can't even figure out how to copy my actual code
into this question - ctl F9 doesn't work within this question box and doing
Edit, Copy, then Edit, Paste doesn't work either. I can send it to you as a
Word attachment if that would help.

Thanks - I'm sure this is simple but I'm stumped at the moment.
 
D

Doug Robbins - Word MVP

Use

{ IF { MERGEFIELD testfield } = "M" "in memory of { MERGEFIELD firstname }
{ MERGEFIELD lastname }etc." { IF { MERGEFIELD testfield } = "H" "in honour
of { MERGEFIELD firstname } { MERGEFIELD lastname }etc." "." } }

--
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 Retread,

Assuming you're using the mailmerge toolbar to select the various mergefields, you could code your field as:
{IF«TOGGLE»= "M" "in memory of «FIRSTNAME» «LASTNAME». An acknowledgement will be sent as you requested." {IF«TOGGLE»= "H" "in
honour of «FIRSTNAME» «LASTNAME». An acknowledgement will be sent as you requested." "."} }
where «TOGGLE» is the name of the data field containing the 'M', 'H' or nothing.

Note: The field brace pairs (ie '{ }') for the above example are created via Ctrl-F9 - you can't simply type them or copy & paste
them from this message. Likwise, you can't type the chevrons (ie '« »') - they're part of the actual mergefields, which you can
insert from the mailmerge toolbar.
 

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