A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Word » Mailmerge
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

IF THEN ELSE question



 
 
Thread Tools Display Modes
  #1  
Old April 23rd, 2008, 07:46 PM posted to microsoft.public.word.mailmerge.fields
[email protected]
external usenet poster
 
Posts: 2
Default IF THEN ELSE question

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
  #2  
Old April 23rd, 2008, 08:44 PM posted to microsoft.public.word.mailmerge.fields
Doug Robbins - Word MVP
external usenet poster
 
Posts: 8,239
Default IF THEN ELSE question

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

wrote in message
...
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



  #3  
Old April 24th, 2008, 03:23 PM posted to microsoft.public.word.mailmerge.fields
[email protected]
external usenet poster
 
Posts: 2
Default IF THEN ELSE question

On Apr 23, 3:44*pm, "Doug Robbins - Word MVP"
wrote:
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

wrote in message

...



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- Hide quoted text -


- Show quoted text -


Perfect!!!!

Many thanks
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 03:47 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.