Removing blank lines in Bookmarks?

L

Lee

Hi everyone,
Can you advise me on whether there is a way to remove the
blank lines in an address under the following
circumstances?
I've got an Access Database and I'm using various
functions to put the contents of the fields within a form
into a 'Form Letter'. The functions use bookmarks within
a template to insert the name and address etc..
Within the address fields there are some blank lines
which looks rather 'naff' and I'd like to be able to
remove them.
Within Access you use the Trim function but this doesn't
seem to work in Word or if it does I'm obviously doing it
wrong! Can you help?

With many thanks,

Lee
 
M

macropod

Hi Lee,

Try something like the following, which uses SET fields for demo purposes,
though you could simply put mergefields into them. The example uses an IF
test to evaluate whether a line feed (ASCII 11) is needed, based on whether
there is a 'Company Name' to print.

{QUOTE
{SET Name "Name"}
{SET CompanyName "Company Name"}
{SET Address "123 zzz"}
{SET City "City"}
{SET State "ABC"}
{SET Zip "1234"}
{Name}11{CompanyName}{IF{CompanyName}= "" "" {QUOTE 11}}
{Address}11{City}160{State}160{Zip}
}

Note: You'll need to convert this to a compound field, replacing the braces
in pairs with Ctrl-F9. Other than that, the layout is for readability.

Cheers
 

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