want to change mail merge from all caps to title capitalzed

J

jp

We are working with a mail merge from our AS/400. We have the data pulled in
but on the 400 input is in all capitials. Is there a way top change the info
from all capitals to normal 'title capitalized'?
 
P

Peter Jamieson

You can use \*Caps, \*Lower, \*FirstCap within each merge field to do fairly
simple capitalization.

However, although \*Caps changes an uppercase string to lowercase except the
initial letters of each Word, \*Firstcap just sets the first letter to upper
case without changing any of the others. So to use FirstCap successfully you
would probably need e.g.

{ QUOTE { MERGEFIELD myfield \*Lower } \*Firstcap }

where all the {} are the special field code braces you can insert using
ctrl-F9.

Alternatively, if the conditions are favourable you may be able to do this
if there are suitable functions that you can use in the SQL query used to
retrieve your data. You would probably have to be getting your data via MS
Query, or writing your own OpenDataSource statements in VBA, or getting your
data via Access. The advantage would be that you didn't have to use these
formatting switches for every merge field. But I don't know whether the
AS400 ODBC driver would let you do that.
 
J

jp

Hi I tried to add the codes but it did not seem to work.. also after the
merge... the field did not show the changes id made..

Here are 2 fields:
«PFRNAM» «PLSNAM»

would you be able to show me how they should look after i add the case
adjustments?

thanks
jp
 
P

Peter Jamieson

You have to use Alt-F9 to show the underlying codes. Then you will see e.g.

{ MERGEFIELD PFRNAM } or { MERGEFIELD "PFRNAM" }, and possibly a switch such
as \*Mergeformat.

You then need to change this to

{ MERGEFIELD PRFNAM \*Lower }

(Just type the new text)

Then you need to nest that entire field inside another field, so select the
entire field, and press ctrl-F( to insert a new pair of Field braces. You
should see

{ { MERGEFIELD PRFNAM \*Lower } }

Type QUOTE and a space after the first {
and a space followed by \*FirstCap before the last }
ending up with
{ QUOTE { MERGEFIELD myfield \*Lower } \*Firstcap }

Then select the fields, press F9 to re-execute them, then Alt-F9 to show
"results". You will probably see «Pfrnam» . Then use the ABC button to show
the data from the currently selected record, and fix the other mergefields
using the same approach.
 
J

jp

Thanks i found it.. using rightclick, toggle field codes...
Can i ask you one more question?

We have a field PATSTR this is the patients address, so an example would
be "123 Washiungton St." When i use the «Patst2» with the \*lower
\*Firstcap The field comes up as 123 washington st. This makes sense as
the first value in that field is capitalized... Is there a command that
reads *firstcap of each word in a field? so that it would read '123
Washinton St'




Thanks again for your assistance...
 

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