Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Mailmerge and Fax / April 2007

Tip: Looking for answers? Try searching our database.

Suppress Blank Data

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
John B - 09 Apr 2007 16:04 GMT
I am putting together a mail merge from access consisting of names and
address'. Included in the name is middle name. The field name for middle name
is mname. I would like to suppress the mname field every time that there is
no data in that field. I know how to suppress blank data in access, but do
not know how in word. I tried the same format from access, but it did not
work. The reason I am doing this through word, instead of access, is that I
have to rotate the font 90 degrees to go on the label.
Thanks.

John
Peter Jamieson - 09 Apr 2007 18:22 GMT
The problem isn't usually suppressing the field, but ensuring that the blank
space you need when the field has something in it is not there when the
field is empty.

e.g. suppose you have

{ MERGEFIELD firstname } { MERGEFIELD middlename } { MERGEFIELD lastname }

If firstname is Peter and lastname is Jamieson, but middlename is blank, you
will get

Peter  Jamieson

(i.e. with two spaces between the names).

To suppress that you can for example
a. use the \b switch in the MERGEFIELD field in Word 2002 and later to
insert the necessary spaces, e.g.

{ MERGEFIELD firstname }{ MERGEFIELD middlename \b " " }{ MERGEFIELD
lastname \b " " }

b. use nested IF fields, e.g.

{ MERGEFIELD firstname
}{ IF "{ MERGEFIELD middlename }" = "" "" " { MERGEFIELD middlename }"
}{ IF "{ MERGEFIELD lastname }" = "" "" " { MERGEFIELD lastname }" }

c. create an Access query that returns exactly the string you want,
typically using iif functions to insert additional space when the related
field is non-blank, then use that as the data source for the merge. If you
are more familiar with the Access query language than the Word field
language, there's a lot to be said for constructing the entire address that
way.

NB, all the {} need to be the special field codes you can insert using
ctrl-F9, not the ordinary keyboard characters.

Peter Jamieson
>I am putting together a mail merge from access consisting of names and
> address'. Included in the name is middle name. The field name for middle
[quoted text clipped - 9 lines]
>
> John
John B - 09 Apr 2007 20:52 GMT
Peter,

   Thanks for this info. It worked like a charm. I have done plenty of
query's in access, but I never gave it a thought about doing this there. Your
information will be useful doing other mail merges from excel and other types
of txt or csv's. Thanks again.

John

> The problem isn't usually suppressing the field, but ensuring that the blank
> space you need when the field has something in it is not there when the
[quoted text clipped - 48 lines]
> >
> > John

Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.