Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Mark Mark is offline
external usenet poster
 
Posts: 182
Default Limiting text to one line

The main document that we use for a mail merge has a line for the name of the
company. This name merges from the database. How do I get the company name
to only fit on the one line regardless of length, within reason?


  #2   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Jamieson Peter Jamieson is offline
external usenet poster
 
Posts: 4,582
Default Limiting text to one line

Your best bet is if you can modify your data source to return a number
that is related to the length of the text. For example, if your data
source is Access, you may be able to create a query that returns the
number of characters in the company name. Then you can use a nested if
field that inserts the name formatted at various different point sizes
(or perhaps you squeeze the cahracters together a bit on particularly
long addresses).

e.g. you have a new field called textlen and you do something like

{ IF { MERGEFIELD textlen } 40 "{ MERGEFIELD companyname \*Charformat
}" "{ IF { MERGEFIELD textlen } 60 "{ MERGEFIELD companyname
\*Charformat }" "etc." }" }

where each { MERGEFIELD companyname \*Charformat } field is formatted
the way you want.

Obviously unless you are using a fixed width font the character count is
only a guide to the width of the inserted text but you can probably find
an approach that will work except in extreme cases.

If you can't get a measure of the text length from the data source, you
could I suppose do the same thing using a whole lot of IF fields that
use wildcards. In this case you would not need to nest. e.g.

{ IF { MERGEFIELD companyname } = "?" "{ MERGEFIELD companyname
\*Charformat }" ""
}{ IF { MERGEFIELD companyname } = "??" "{ MERGEFIELD companyname
\*Charformat }" ""
}{ IF { MERGEFIELD companyname } = "???" "{ MERGEFIELD companyname
\*Charformat }" ""
}{ IF { MERGEFIELD companyname } = "????" "{ MERGEFIELD companyname
\*Charformat }" ""
}

etc. Not sure how far that approach gets you but it's fairly easy to set
up and test.


Peter Jamieson

http://tips.pjmsn.me.uk

Mark wrote:
The main document that we use for a mail merge has a line for the name of the
company. This name merges from the database. How do I get the company name
to only fit on the one line regardless of length, within reason?


Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
limiting the size of a text field on a form in word 2007 Training Guy Microsoft Word Help 4 January 4th 08 09:44 AM
Limiting range of TOC Gringotavy Microsoft Word Help 4 January 26th 06 11:07 PM
Limiting the amount of text Susan48 Microsoft Word Help 2 October 25th 05 06:22 AM
Limiting form field text Monterey Magic Microsoft Word Help 1 September 28th 05 09:20 PM
Limiting number of lines of unprotected text in a document graphicguy Microsoft Word Help 5 July 1st 05 08:45 PM


All times are GMT +1. The time now is 04:48 AM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"