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