My data fields are FirstName, MiddleInitial, LastName and some people do not
have a middle initial so that field is blank for them in the data source.
When it prints, the people without a middle initial have two spaces between
their first and last names! Please help. thank you.
{ IF { MERGEFIELD Initial } <> "" "{ MERGEFIELD Initial } { MERGEFIELD
LastName }" "{ MERGEFIELD LastName }" }
You must use Ctrl+F9 to insert each pair of field delimiters { } and you use
Alt+F9 to toggle off their display.
--
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
"Jillie" <Jil...@discussions.microsoft.com> wrote in message
news:6273B2EE-150C-4532...@microsoft.com...
--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP
My web site www.gmayor.com
Word MVP web site http://word.mvps.org
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Doug Robbins - Word MVP wrote:
> You need to use and If...then...Else field construction
>
> { IF { MERGEFIELD Initial } <> "" "{ MERGEFIELD Initial } { MERGEFIELD
> LastName }" "{ MERGEFIELD LastName }" }
>
> You must use Ctrl+F9 to insert each pair of field delimiters { } and
> you use Alt+F9 to toggle off their display.
>
>
The complete name construction (all on one naturally wrapped line) would be
{MERGEFIELD FirstName}<space>{ IF { MERGEFIELD Initial } <> "" "{ MERGEFIELD
Initial }<space>{MERGEFIELD LastName }"<Space>"{ MERGEFIELD LastName }" }
or alternatively
{MERGEFIELD FirstName}<Space>{ IF { MERGEFIELD Initial } <> "" "{ MERGEFIELD
Initial }<Space>"}{ MERGEFIELD LastName }
Press Space where indicated as <Space>
--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP
My web site www.gmayor.com
Word MVP web site http://word.mvps.org
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Jillie wrote:
> Thanks so much Doug and Graham,
> Where in the process do I input this code? I am using the individual
> fields and not the address block. i figured that out :-)
> Jillie
>
> "Doug Robbins - Word MVP" wrote:
>
>> You need to use and If...then...Else field construction
>>
>>
>>
Using your field names, where you want the name of the person to appear use
{ MERGEFIELD First_Name_1 } { IF { MERGEFIELD M } <> "" "{ MERGEFIELD M }
{ MERGEFIELD
Last_Name_1 }" "{ MERGEFIELD Last_Name_1 }" }
If you want to avoid having to type the names of the merge fields, from the
merge field pull down insert
<<First_Name_1>> <<M>> <<M>> <<Last_Name_1>><<Last_Name_1>>
The press Alt+F9 and you should see
{ MERGEFIELD First_Name_1 } { MERGEFIELD M } { MERGEFIELD M } { MERGEFIELD
Last_Name_1 }{ MERGEFIELD Last_Name_1 }
Now select everything EXCEPT the { MERGEFIELD First_Name_1 } and press
CTRL+F9 and you should get
{ { MERGEFIELD M } { MERGEFIELD M } { MERGEFIELD Last_Name_1 }{ MERGEFIELD
Last_Name_1 } }
Inside the { { type IF and after the first { MERGEFIELD M } insert <> "" "
and between the two Last_Name_1 merge fields, insert " " and another "
between the closing } }
You must have spaces either side of the <> and between the "" and " and
between the " and ". There also needs to be a space after the { MERGEFIELD
First_Name_1 } and between the { MERGEFIELD M } and the { MERGEFIELD
Last_Name_1 }. There should be NO space however between the " and the { of
the final { MERGEFIELD Last_Name_1 }
It does not matter if the merge fields appear as { MERGEFIELD First_Name_1 }
or { MERGEFIELD "First_Name_1" }
You press Alt+F9 to toggle off the display of the mergefields.
--
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
"Jillie" <Jil...@discussions.microsoft.com> wrote in message
news:9296A5D9-2CE2-450A...@microsoft.com...