Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
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
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
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
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
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
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
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
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
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
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
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
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
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
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
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
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
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
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
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
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
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 | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Complex Mail merges | Mailmerge | |||
Mail Merges | Mailmerge | |||
VBA & Mail merges | Mailmerge | |||
Word keeps creating mail merges, how do I turn it off? | Mailmerge | |||
Mail merges | Tables |