create a labels merge document

J

Jack B

Re Word 97 ----

I am trying to create a labels merge document with TITLE, FIRSTNAME, &
LASTNAME. Not a problem, except that I want there to be NO space in front
of FIRSTNAME if there is no title associated with the name. I've tried
{IF { MERGEFIELD TITLE } <> "" "{ MERGEFIELD TITLE } "}{ MERGEFIELD
FIRSTNAME } { MERGEFIELD LASTNAME }

but that makes no space between the Title and the Firstname. If I make a
space between TITLE and FIRSTNAME brackets, then even names with no title
have a space in front of them.

How do I make a space between the TITLE and FIRSTNAME while making no space
in front of FIRSTNAME if there is no TITLE?

Jack
 
S

Suzanne S. Barnhill

The syntax you're using should be working, but try this syntax instead:

{ IF { MERGEFIELD TITLE } = "" "{ MERGEFIELD FIRSTNAME } { MERGEFIELD
LASTNAME }" "{ MERGEFIELD TITLE } { MERGEFIELD FIRSTNAME } { MERGEFIELD
LASTNAME }" }



--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA

Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.
 
J

Jack B

Suzanne,

I get the same results.
Perhaps I'm not implementing correctly.

This is what I'm doing:
Create Mail labels: TOOLS/MAIL MERGE/CREATE/MAILING LABELS/ETC. and, after
choosing the type of label, go to INSERT MERGE FIELD; then, choose TITLE and
then copy and paste {IF { MERGEFIELD TITLE } <> "" "{ MERGEFIELD TITLE } "}

(actually, you need to copy before doing TOOLS/MAIL MERGE/CREATE/MAILING
LABELS)

into the << >> bracket TITLE, and delete that TITLE. So now it looks like
<<{IF { MERGEFIELD TITLE } <> "" "{ MERGEFIELD TITLE } "}>>

Which what I also did with the syntax you suggested.
What am I doing wrong?

Jack




The syntax you're using should be working, but try this syntax instead:

{ IF { MERGEFIELD TITLE } = "" "{ MERGEFIELD FIRSTNAME } { MERGEFIELD
LASTNAME }" "{ MERGEFIELD TITLE } { MERGEFIELD FIRSTNAME } { MERGEFIELD
LASTNAME }" }



--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA

Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.
 
S

Suzanne S. Barnhill

Aside from the fields which you insert using buttons in Word, you must
insert each field using Ctrl+F9. If you are just typing the braces (or
copy/pasting them from somewhere), then the fields are not fields and won't
work. You can create an IF field using a button on the Mail Merge toolbar,
but it expects text as the TrueText and FalseText, so it's rather difficult
to insert fields (you have to insert placeholder text and then replace with
mergefields) and therefore easier to create the field by hand.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA

Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.
 
J

Jack B

Suzanne,

I have tried for over an hour to make this work, but no luck.

Could you please be more specific with the steps I should take.

I am doing a mailing labels merge using an Excel data source.

I get to the point in Word where I set up the main document, choose the
mailing labels, and I'm at CREATE LABELS | INSERT MERGE FIELD.

From that point I've tried what seem like a dozen variations with no
success. I'm most inclined to select TITLE and then delete TITLE which
leaves << >>. And then I use Ctl+F9 to enter brackets inside the << >> and
manually type inside the brackets. But, like I say, I don't get the right
results.

Jack



Aside from the fields which you insert using buttons in Word, you must
insert each field using Ctrl+F9. If you are just typing the braces (or
copy/pasting them from somewhere), then the fields are not fields and won't
work. You can create an IF field using a button on the Mail Merge toolbar,
but it expects text as the TrueText and FalseText, so it's rather difficult
to insert fields (you have to insert placeholder text and then replace with
mergefields) and therefore easier to create the field by hand.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA

Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.
 
D

Doug Robbins - Word MVP

You cannot enter the field delimiters { } in

{IF { MERGEFIELD TITLE } <> "" "{ MERGEFIELD TITLE } "}

from the keyboard.

What you need to do is press Ctrl+F9 to insert

{ }

inside that type IF and then with the cursor after the F, press Ctrl+F9
again so that you have

{ IF { }}

Then, inside the inner { }, type MERGEFIELD TITLE and between the } } type
<> "" so that you have

{IF { MERGEFIELD TITLE } <> "" "}

Then before the last }. type Ctrl + F9 again and inside that pair of field
delimiters type MERGEFIELD TITLE and enter a space after the field delimiter
and then the closing quote mark, then another space and then a pair of empty
quote marks with nothing between them.

{IF { MERGEFIELD TITLE } <> "" "{ MERGEFIELD TITLE } " "" }

Then you Firstname mergefield must come immediately after that construction
with no space in between

{IF { MERGEFIELD TITLE } <> "" "{ MERGEFIELD TITLE } " "" }{ MERGEFIELD
FIRSTNAME }

You will of course need to make sure that the records in Excel that do not
have a title, do not have a space in that field as that would return that
space as it is not equal to ""

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

Suzanne S. Barnhill

Doug has told you one way to do this. The other is:

1. On the Mail Merge toolbar, click Insert Word Field and select
If...Then...Else. This opens the Insert Word Field: IF dialog.

2. In the dialog, select Title as the field name and "is blank" or "is not
blank" as the condition (depending on the results desired).

3. In the "Insert this text" and "Otherwise insert this text" boxes, type
"TrueText" and "FalseText."

4. Click OK to close the dialog.

5. Back in the mail merge main document, make sure you are seeing the actual
IF field; you should not be seeing any chevrons; you should be seeing field
braces (if not, press Alt+F9 to see the field).

6. In place of your "TrueText" placeholder, insert the field construction
you want Word to insert if the condition is true (if the Title field is/is
not blank). Use the Insert Merge Field button to do this.

7. Repeat for the FalseText.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA

Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.
 
J

Jack B

Doug & Suzanne --

Thanks, I finally got it!

Too bad you can't paste the expressions into place.


Jack
 
S

Suzanne S. Barnhill

Yes, I would love to see that dialog improved.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA

Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.
 

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