Word Field in Mail Merge?

E

elfmajesty

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

elfmajesty

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
 
D

Doug Robbins - Word MVP

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 said:
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 said:
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!
 
E

elfmajesty

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 said:
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 said:
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 said:
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!
 
P

Peter Jamieson

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

:

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!
 

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