IF THEN ELSE question

G

gabo.mercado

I need to create a mail-merge document where I have 2 mergefields, if
one is blank I want to print the other merge field. How do I do this
in Office 2007?

The logic is below

If mergefield1 is blank
print mergefield2
else
print mergefield1


{mergefield may/may not have a value and mergefield2 always has a
value}

Thanks for any help
 
D

Doug Robbins - Word MVP

Use

{ IF { MERGEFIELD Mergefield1 } <> "" { MERGEFIELD Mergefield1 } {
MERGEFIELD Mergefield2 } }

You must use Ctrl+F9 for each pair of field delimiters { } and use Alt+F9 to
toggle off their display. You also must have a space either side of the <>
and also separating the condition from the result and between each result.

--
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
 
G

gabo.mercado

Use

{ IF { MERGEFIELD Mergefield1 } <> "" { MERGEFIELD Mergefield1 } {
MERGEFIELD Mergefield2 } }

You must use Ctrl+F9 for each pair of field delimiters { } and use Alt+F9 to
toggle off their display.  You also must have a space either side of the<>
and also separating the condition from the result and between each result.

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










- Show quoted text -

Perfect!!!!

Many thanks
 

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