Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
![]()
Hello. I have an easy one - just can't remember how to do it!! I have
created a mail merge Label and set up my fields. We are including the Title field in our set-up. However, some of the data does not use the Title field (i.e. Mr. John Doe - [Title First Last] versus Jane Smith - [First Last]). I need to use (I think!) the If-Then-Else to say if the Title field is blank, move to the First Name field and DO NOT leave a blank space. What we are getting right now after the merge is show below. Mr. John Doe 123 Some Street City, State Zip Jane Smith 123 Some Street City, State Zip (Note the space where the Title field should be) We need: Mr. John Doe 123 Some Street Jane Smith 123 Some Street Can someone help me out?? Thanks! |
#2
![]()
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
![]()
By the way, I am using Graham's website advice and have formatted the first
line as follows: {MERGEFIELD "Title"}{IF {MERGEFIELD "Title"}= "" "" " "} {MERGEFIELD "FirstName"} {MERGEFIELD "LastName"} and I am getting as a result: Mr.MERGEFIELD John Doe "elfmajesty" wrote: Hello. I have an easy one - just can't remember how to do it!! I have created a mail merge Label and set up my fields. We are including the Title field in our set-up. However, some of the data does not use the Title field (i.e. Mr. John Doe - [Title First Last] versus Jane Smith - [First Last]). I need to use (I think!) the If-Then-Else to say if the Title field is blank, move to the First Name field and DO NOT leave a blank space. What we are getting right now after the merge is show below. Mr. John Doe 123 Some Street City, State Zip Jane Smith 123 Some Street City, State Zip (Note the space where the Title field should be) We need: Mr. John Doe 123 Some Street Jane Smith 123 Some Street Can someone help me out?? Thanks! |
#3
![]()
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
![]()
You should be using:
{IF {MERGEFIELD "Title"}= "" "{MERGEFIELD "FirstName"} {MERGEFIELD "LastName"}" "{MERGEFIELD "Title"} {MERGEFIELD "FirstName"} {MERGEFIELD "LastName"}" } You must use Ctrl+F9 for each pair of field delimiters. -- 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 "elfmajesty" wrote in message ... By the way, I am using Graham's website advice and have formatted the first line as follows: {MERGEFIELD "Title"}{IF {MERGEFIELD "Title"}= "" "" " "} {MERGEFIELD "FirstName"} {MERGEFIELD "LastName"} and I am getting as a result: Mr.MERGEFIELD John Doe "elfmajesty" wrote: Hello. I have an easy one - just can't remember how to do it!! I have created a mail merge Label and set up my fields. We are including the Title field in our set-up. However, some of the data does not use the Title field (i.e. Mr. John Doe - [Title First Last] versus Jane Smith - [First Last]). I need to use (I think!) the If-Then-Else to say if the Title field is blank, move to the First Name field and DO NOT leave a blank space. What we are getting right now after the merge is show below. Mr. John Doe 123 Some Street City, State Zip Jane Smith 123 Some Street City, State Zip (Note the space where the Title field should be) We need: Mr. John Doe 123 Some Street Jane Smith 123 Some Street Can someone help me out?? Thanks! |
#4
![]()
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
![]()
Doug,
Thank you for your post. I see what you are I'm very familiar with ctl+F9 but I'm not sure I understand what you mean about EACH pair. Does that mean I will have to highlight the whole string when finished and ctl+F9 that to enclose it? So, if I'm reading correctly, in your example I would need to do the ctl+F9 seven (7) times. I've done this and I am still getting strange results. Also, I seem to recall this being MUCH easier in Word 2000. I noticed in Word 2003 on the Mail Merge toolbar that I have the Insert Word Field button. That brings me to the IF-THEN-ELSE wizard. Can I use that to write the statement? What's throwing me is the "Compare To" section (see below) If: Field Name: [Title] Comparison: [is blank] Compare to: [what do I put here?] Then: Insert Text: [which I want to be the FirstName field] Otherwise: [which I want to be the Title field plus a space] Thanks for any advice. I'm continuing to work on this. Elf "Doug Robbins - Word MVP" wrote: You should be using: {IF {MERGEFIELD "Title"}= "" "{MERGEFIELD "FirstName"} {MERGEFIELD "LastName"}" "{MERGEFIELD "Title"} {MERGEFIELD "FirstName"} {MERGEFIELD "LastName"}" } You must use Ctrl+F9 for each pair of field delimiters. -- 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 "elfmajesty" wrote in message ... By the way, I am using Graham's website advice and have formatted the first line as follows: {MERGEFIELD "Title"}{IF {MERGEFIELD "Title"}= "" "" " "} {MERGEFIELD "FirstName"} {MERGEFIELD "LastName"} and I am getting as a result: Mr.MERGEFIELD John Doe "elfmajesty" wrote: Hello. I have an easy one - just can't remember how to do it!! I have created a mail merge Label and set up my fields. We are including the Title field in our set-up. However, some of the data does not use the Title field (i.e. Mr. John Doe - [Title First Last] versus Jane Smith - [First Last]). I need to use (I think!) the If-Then-Else to say if the Title field is blank, move to the First Name field and DO NOT leave a blank space. What we are getting right now after the merge is show below. Mr. John Doe 123 Some Street City, State Zip Jane Smith 123 Some Street City, State Zip (Note the space where the Title field should be) We need: Mr. John Doe 123 Some Street Jane Smith 123 Some Street Can someone help me out?? Thanks! |
#5
![]()
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
![]()
but I'm not sure I understand what you mean about EACH pair.
Doug simply means that the {} need to be the special field code braces that you can insert using ctrl-F9, not the ordinary characters "{" and "}". And yes, I count 7 pairs in the construciton he gave you. If you have already inserted them by other means, that's fine. However, if your code only needs to work in Word 2003 (and maybe 2002) then there is another approach to dealing with spaces in some scenarios, which is to use the \b and \f switches in the MERGEFIELD field, e.g.: { MERGEFIELD Title \f " " }{ MERGEFIELD First \f " " }{ MERGEFIELD Last } The reason most people here prefer to use the "direct approach" to inserting fields is probably because then you have precise control over what you're doing. Peter Jamieson "elfmajesty" wrote in message ... Doug, Thank you for your post. I see what you are I'm very familiar with ctl+F9 but I'm not sure I understand what you mean about EACH pair. Does that mean I will have to highlight the whole string when finished and ctl+F9 that to enclose it? So, if I'm reading correctly, in your example I would need to do the ctl+F9 seven (7) times. I've done this and I am still getting strange results. Also, I seem to recall this being MUCH easier in Word 2000. I noticed in Word 2003 on the Mail Merge toolbar that I have the Insert Word Field button. That brings me to the IF-THEN-ELSE wizard. Can I use that to write the statement? What's throwing me is the "Compare To" section (see below) If: Field Name: [Title] Comparison: [is blank] Compare to: [what do I put here?] Then: Insert Text: [which I want to be the FirstName field] Otherwise: [which I want to be the Title field plus a space] Thanks for any advice. I'm continuing to work on this. Elf "Doug Robbins - Word MVP" wrote: You should be using: {IF {MERGEFIELD "Title"}= "" "{MERGEFIELD "FirstName"} {MERGEFIELD "LastName"}" "{MERGEFIELD "Title"} {MERGEFIELD "FirstName"} {MERGEFIELD "LastName"}" } You must use Ctrl+F9 for each pair of field delimiters. -- 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 "elfmajesty" wrote in message ... By the way, I am using Graham's website advice and have formatted the first line as follows: {MERGEFIELD "Title"}{IF {MERGEFIELD "Title"}= "" "" " "} {MERGEFIELD "FirstName"} {MERGEFIELD "LastName"} and I am getting as a result: Mr.MERGEFIELD John Doe "elfmajesty" wrote: Hello. I have an easy one - just can't remember how to do it!! I have created a mail merge Label and set up my fields. We are including the Title field in our set-up. However, some of the data does not use the Title field (i.e. Mr. John Doe - [Title First Last] versus Jane Smith - [First Last]). I need to use (I think!) the If-Then-Else to say if the Title field is blank, move to the First Name field and DO NOT leave a blank space. What we are getting right now after the merge is show below. Mr. John Doe 123 Some Street City, State Zip Jane Smith 123 Some Street City, State Zip (Note the space where the Title field should be) We need: Mr. John Doe 123 Some Street Jane Smith 123 Some Street Can someone help me out?? Thanks! |
Reply |
Thread Tools | |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Word 97 in Windows XP to maintain formatting | Microsoft Word Help | |||
Need help with Field Codes | New Users | |||
Editing Mail Merge Recipients | Mailmerge | |||
Format Fractions in Mail Merge. | Mailmerge | |||
Possible to insert a file into Word based on a mail merge field? | Mailmerge |