View Single Post
  #4   Report Post  
Posted to microsoft.public.word.docmanagement,microsoft.public.word.mailmerge.fields
Doug Robbins - Word MVP Doug Robbins - Word MVP is offline
external usenet poster
 
Posts: 8,832
Default leading spaces in merge fields

Use an If...then...Else field construction

{ If { MERGEFIELD DateBorn } = "" "{ MERGEFIELD BornWhere}." "{ MERGEFIELD
BornWhere } { MERGEFIELD DateBorn }." }

You must use Ctrl + F9 to insert each pair of field delimiters { } and you
use Alt + F9 to toggle off their display. Also, you may need to update the
fields in the document after executing the merge - Ctrl + A, then F9.

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

"LCalaway" wrote in message
...
I am using Office 2003 XP

Here is a portion of my merge document:

«BodyName», «Aged», whose occupation is «Occupation», was born in
«BornWhere»«DateBorn» «Mr» presently resides at «Lives». He

If the Access field that fills in the data for DateBorn is null, a period
is
placed at the end of BornWhere. If the Access field that fills in the
data
for DateBorn contains a date, the date is preceded by a space. The info
in
Access is the result of a query that adds the leading space, which it does
perfectly, but the merge strips out the leading space. How can i keep the
leading space?





"Cindy M." wrote:

Hi ?B?TENhbGF3YXk=?=,

I have created a "script" in Word which is filled in by using Access
and
merge. The script works wonderfully EXCEPT if there is a leading space
in
one of the fields. The merge eliminates the leading space. What would
be
the suggestion to retain the leading space that is definitely IN the
database
field in Access.

I'm linking this response to the more specialized word.mailmerge.fields
newsgroup. Please provide the version of Office involved and include the
script
(so that we can see which connection method is being used).

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or
reply
in the newsgroup and not by e-mail :-)