Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.mailmerge.fields
John Salerno John Salerno is offline
external usenet poster
 
Posts: 20
Default Creating an If...Then...Else rule for mail merges

Hi everyone. If I have a "Nickname" column in my data table and want to
create a rule such as this:

If Nickname is not blank, then use Nickname, else use First Name.

The reverse of that rule would also work. (If it's blank, use First Name,
else use Nickname.)

But how do I do this? Looking at the options for the If rules, I don't see a
way to do something this specific. It only seems you can check a data entry
and then substitute actual text, not another field value.

Thanks!


  #2   Report Post  
Posted to microsoft.public.word.mailmerge.fields
macropod[_2_] macropod[_2_] is offline
external usenet poster
 
Posts: 2,059
Default Creating an If...Then...Else rule for mail merges

Hi Mia,

Heres how you can vary the output:
1. Make a duplicate of the nickname mailmerge field, and arrange those fields and the firstname field so that you get something
like:
«Nickname» «FirstName» «Nickname»
2. Press Ctrl-F9, to wrap a field around these, so that you get:
{ «Nickname» «FirstName» «Nickname» }
3. Fill in between the braces, paying careful attention to the spacing, so that you end up with:
{IF«Nickname»= "" «FirstName» «Nickname»}
4. Run your mailmerge.

That should give the result you're after.


--
Cheers
macropod
[MVP - Microsoft Word]


"John Salerno" wrote in message ...
Hi everyone. If I have a "Nickname" column in my data table and want to create a rule such as this:

If Nickname is not blank, then use Nickname, else use First Name.

The reverse of that rule would also work. (If it's blank, use First Name, else use Nickname.)

But how do I do this? Looking at the options for the If rules, I don't see a way to do something this specific. It only seems you
can check a data entry and then substitute actual text, not another field value.

Thanks!


  #3   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Rich/rerat Rich/rerat is offline
external usenet poster
 
Posts: 93
Default Creating an If...Then...Else rule for mail merges

John Salerno,

Try the following IF function in your Word Document, once you link your data
source to the Mail Merge document.



{if {Mergefield First_Name} "" "{Mergefield First_Name}" "{Mergefield
NickName}" }



You can not just type this, you will need to insert the fields into the
formula. A simple way of doing it is as follows.

1. Insert Word Field button Choose If....Then

2. Select if first name Is Not Blank. Which will give you this in your Word
Document.

{if {Mergefield first_name} "" "" "" }

3. Click mouse in the center of the Second double quotes (""). From the Mail
Merge toolbar Select Insert Mail Mergefields button, and choose "First
Name" Apply/OK.

4. Click mouse in the center of the Third double quotes (""). From the Mail
Merge toolbar Select Insert Mail Mergefields button, and choose "NickName"
Apply/OK.




--
Add MS to your News Reader: news://msnews.microsoft.com
Rich/rerat (RRR News) message rule
Previous Text Snipped to Save Bandwidth When Appropriate



"John Salerno" wrote in message
...
Hi everyone. If I have a "Nickname" column in my data table and want to
create a rule such as this:

If Nickname is not blank, then use Nickname, else use First Name.

The reverse of that rule would also work. (If it's blank, use First Name,
else use Nickname.)

But how do I do this? Looking at the options for the If rules, I don't see a
way to do something this specific. It only seems you can check a data entry
and then substitute actual text, not another field value.

Thanks!



  #4   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Graham Mayor Graham Mayor is offline
external usenet poster
 
Posts: 19,312
Default Creating an If...Then...Else rule for mail merges

I think you have that the wrong way round?
{IF {Mergefield NickName} "" "{Mergefield NickName}" "{Mergefield
First_Name}" }

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



Rich/rerat wrote:
John Salerno,

Try the following IF function in your Word Document, once you link
your data source to the Mail Merge document.



{if {Mergefield First_Name} "" "{Mergefield First_Name}"
"{Mergefield NickName}" }



You can not just type this, you will need to insert the fields into
the formula. A simple way of doing it is as follows.

1. Insert Word Field button Choose If....Then

2. Select if first name Is Not Blank. Which will give you this in
your Word Document.

{if {Mergefield first_name} "" "" "" }

3. Click mouse in the center of the Second double quotes (""). From
the Mail Merge toolbar Select Insert Mail Mergefields button, and
choose "First Name" Apply/OK.

4. Click mouse in the center of the Third double quotes (""). From
the Mail Merge toolbar Select Insert Mail Mergefields button, and
choose "NickName" Apply/OK.



  #5   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Rich/rerat Rich/rerat is offline
external usenet poster
 
Posts: 93
Default OT: Creating an If...Then...Else rule for mail merges

Graham Mayor,
Oooops, your right, cause I now see if the contact had both a first name and
a nick name, it would pull the first name, instead of using the nick name
for that contact.

Just curious is there an easy way to copy and paste a Word function formula
from a word document, to a news posting, instead of having to manually type
it out. When I tried to copy and paste the formula for this question, I got
the merge result of the formula, not the formula itself.

--
Add MS to your News Reader: news://msnews.microsoft.com
Rich/rerat (RRR News) message rule
Previous Text Snipped to Save Bandwidth When Appropriate


"Graham Mayor" wrote in message
...
I think you have that the wrong way round?
{IF {Mergefield NickName} "" "{Mergefield NickName}" "{Mergefield
First_Name}" }

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



Rich/rerat wrote:
John Salerno,

Try the following IF function in your Word Document, once you link
your data source to the Mail Merge document.



{if {Mergefield First_Name} "" "{Mergefield First_Name}"
"{Mergefield NickName}" }



You can not just type this, you will need to insert the fields into
the formula. A simple way of doing it is as follows.

1. Insert Word Field button Choose If....Then

2. Select if first name Is Not Blank. Which will give you this in
your Word Document.

{if {Mergefield first_name} "" "" "" }

3. Click mouse in the center of the Second double quotes (""). From
the Mail Merge toolbar Select Insert Mail Mergefields button, and
choose "First Name" Apply/OK.

4. Click mouse in the center of the Third double quotes (""). From
the Mail Merge toolbar Select Insert Mail Mergefields button, and
choose "NickName" Apply/OK.






  #6   Report Post  
Posted to microsoft.public.word.mailmerge.fields
macropod[_2_] macropod[_2_] is offline
external usenet poster
 
Posts: 2,059
Default OT: Creating an If...Then...Else rule for mail merges

Hi Rich,

See: http://www.gmayor.com/export_field.htm

--
Cheers
macropod
[MVP - Microsoft Word]


"Rich/rerat" wrote in message ...
Graham Mayor,
Oooops, your right, cause I now see if the contact had both a first name and
a nick name, it would pull the first name, instead of using the nick name
for that contact.

Just curious is there an easy way to copy and paste a Word function formula
from a word document, to a news posting, instead of having to manually type
it out. When I tried to copy and paste the formula for this question, I got
the merge result of the formula, not the formula itself.

--
Add MS to your News Reader: news://msnews.microsoft.com
Rich/rerat (RRR News) message rule
Previous Text Snipped to Save Bandwidth When Appropriate


"Graham Mayor" wrote in message
...
I think you have that the wrong way round?
{IF {Mergefield NickName} "" "{Mergefield NickName}" "{Mergefield
First_Name}" }

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



Rich/rerat wrote:
John Salerno,

Try the following IF function in your Word Document, once you link
your data source to the Mail Merge document.



{if {Mergefield First_Name} "" "{Mergefield First_Name}"
"{Mergefield NickName}" }



You can not just type this, you will need to insert the fields into
the formula. A simple way of doing it is as follows.

1. Insert Word Field button Choose If....Then

2. Select if first name Is Not Blank. Which will give you this in
your Word Document.

{if {Mergefield first_name} "" "" "" }

3. Click mouse in the center of the Second double quotes (""). From
the Mail Merge toolbar Select Insert Mail Mergefields button, and
choose "First Name" Apply/OK.

4. Click mouse in the center of the Third double quotes (""). From
the Mail Merge toolbar Select Insert Mail Mergefields button, and
choose "NickName" Apply/OK.




  #7   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Graham Mayor Graham Mayor is offline
external usenet poster
 
Posts: 19,312
Default OT: Creating an If...Then...Else rule for mail merges

My lips never moved

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



macropod wrote:
Hi Rich,

See: http://www.gmayor.com/export_field.htm


"Rich/rerat" wrote in message
...
Graham Mayor,
Oooops, your right, cause I now see if the contact had both a first
name and a nick name, it would pull the first name, instead of using
the nick name for that contact.

Just curious is there an easy way to copy and paste a Word function
formula from a word document, to a news posting, instead of having
to manually type it out. When I tried to copy and paste the formula
for this question, I got the merge result of the formula, not the
formula itself. --
Add MS to your News Reader: news://msnews.microsoft.com
Rich/rerat (RRR News) message rule
Previous Text Snipped to Save Bandwidth When Appropriate


"Graham Mayor" wrote in message
...
I think you have that the wrong way round?
{IF {Mergefield NickName} "" "{Mergefield NickName}" "{Mergefield
First_Name}" }

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



Rich/rerat wrote:
John Salerno,

Try the following IF function in your Word Document, once you link
your data source to the Mail Merge document.



{if {Mergefield First_Name} "" "{Mergefield First_Name}"
"{Mergefield NickName}" }



You can not just type this, you will need to insert the fields into
the formula. A simple way of doing it is as follows.

1. Insert Word Field button Choose If....Then

2. Select if first name Is Not Blank. Which will give you this in
your Word Document.

{if {Mergefield first_name} "" "" "" }

3. Click mouse in the center of the Second double quotes (""). From
the Mail Merge toolbar Select Insert Mail Mergefields button, and
choose "First Name" Apply/OK.

4. Click mouse in the center of the Third double quotes (""). From
the Mail Merge toolbar Select Insert Mail Mergefields button, and
choose "NickName" Apply/OK.



  #8   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Rich/rerat Rich/rerat is offline
external usenet poster
 
Posts: 93
Default OT: Creating an If...Then...Else rule for mail merges

Graham Mayor & macropod,
Thank-you both.

--
Add MS to your News Reader: news://msnews.microsoft.com
Rich/rerat (RRR News) message rule
Previous Text Snipped to Save Bandwidth When Appropriate


"" wrote in message
...
My lips never moved

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



macropod wrote:
Hi Rich,

See: http://www.gmayor.com/export_field.htm


"Rich/rerat" wrote in message
...
Graham Mayor,
Oooops, your right, cause I now see if the contact had both a first
name and a nick name, it would pull the first name, instead of using
the nick name for that contact.

Just curious is there an easy way to copy and paste a Word function
formula from a word document, to a news posting, instead of having
to manually type it out. When I tried to copy and paste the formula
for this question, I got the merge result of the formula, not the
formula itself. --
Add MS to your News Reader: news://msnews.microsoft.com
Rich/rerat (RRR News) message rule
Previous Text Snipped to Save Bandwidth When Appropriate


"Graham Mayor" wrote in message
...
I think you have that the wrong way round?
{IF {Mergefield NickName} "" "{Mergefield NickName}" "{Mergefield
First_Name}" }

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



Rich/rerat wrote:
John Salerno,

Try the following IF function in your Word Document, once you link
your data source to the Mail Merge document.



{if {Mergefield First_Name} "" "{Mergefield First_Name}"
"{Mergefield NickName}" }



You can not just type this, you will need to insert the fields into
the formula. A simple way of doing it is as follows.

1. Insert Word Field button Choose If....Then

2. Select if first name Is Not Blank. Which will give you this in
your Word Document.

{if {Mergefield first_name} "" "" "" }

3. Click mouse in the center of the Second double quotes (""). From
the Mail Merge toolbar Select Insert Mail Mergefields button, and
choose "First Name" Apply/OK.

4. Click mouse in the center of the Third double quotes (""). From
the Mail Merge toolbar Select Insert Mail Mergefields button, and
choose "NickName" Apply/OK.




  #9   Report Post  
Posted to microsoft.public.word.mailmerge.fields
John Salerno John Salerno is offline
external usenet poster
 
Posts: 20
Default Creating an If...Then...Else rule for mail merges

"macropod" wrote in message
...

Heres how you can vary the output:
1. Make a duplicate of the nickname mailmerge field, and arrange those
fields and the firstname field so that you get something like:
«Nickname» «FirstName» «Nickname»
2. Press Ctrl-F9, to wrap a field around these, so that you get:
{ «Nickname» «FirstName» «Nickname» }
3. Fill in between the braces, paying careful attention to the spacing, so
that you end up with:
{IF«Nickname»= "" «FirstName» «Nickname»}
4. Run your mailmerge.

That should give the result you're after.


Thanks! That works great! Too bad it's rather messy (as opposed to having
this process built-in).

Now, is there some way to save this functionality so that I don't have to
re-create this each time?


  #10   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Doug Robbins - Word MVP Doug Robbins - Word MVP is offline
external usenet poster
 
Posts: 8,832
Default Creating an If...Then...Else rule for mail merges

Use Copy and Paste or create an autotext entry of the field construction.
(Actually, that is not complicated; You should see some of the other ones
that macropod comes up with.)

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

"John Salerno" wrote in message
...
"macropod" wrote in message
...

Heres how you can vary the output:
1. Make a duplicate of the nickname mailmerge field, and arrange those
fields and the firstname field so that you get something like:
«Nickname» «FirstName» «Nickname»
2. Press Ctrl-F9, to wrap a field around these, so that you get:
{ «Nickname» «FirstName» «Nickname» }
3. Fill in between the braces, paying careful attention to the spacing,
so that you end up with:
{IF«Nickname»= "" «FirstName» «Nickname»}
4. Run your mailmerge.

That should give the result you're after.


Thanks! That works great! Too bad it's rather messy (as opposed to having
this process built-in).

Now, is there some way to save this functionality so that I don't have to
re-create this each time?





  #11   Report Post  
Posted to microsoft.public.word.mailmerge.fields
John Salerno John Salerno is offline
external usenet poster
 
Posts: 20
Default Creating an If...Then...Else rule for mail merges

"Doug Robbins - Word MVP" wrote in message
...
Use Copy and Paste or create an autotext entry of the field construction.
(Actually, that is not complicated; You should see some of the other ones
that macropod comes up with.)


Wow, never used AutoText before but it works great! Thanks!


Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Complex Mail merges katrina Mailmerge 1 January 14th 08 03:05 AM
Mail Merges Julie Mailmerge 1 March 7th 06 07:36 AM
VBA & Mail merges Clarkie Mailmerge 1 April 12th 05 11:38 AM
Word keeps creating mail merges, how do I turn it off? Sandie Mailmerge 1 February 17th 05 02:48 PM
Mail merges Holly Tables 1 December 3rd 04 07:30 PM


All times are GMT +1. The time now is 05:37 AM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"