View Single Post
  #2   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Jamieson
 
Posts: n/a
Default One Letter Names in Salutation

You can test using e.g.

{ IF "{ MERGEFIELD myfield }" = "?" "one letter" "not one letter" }

because "?" is a wildcard that detects a single letter. Notice that "" will
also result in "not one letter". Beyond that, it is a question of exactly
what you need - for example, if you have a Title field you might use

Dear { IF "{ MERGEFIELD firstname }" = "?" "{ MERGEFIELD title } {
MERGEFIELD lastname }"
"{ MERGEFIELD firstname }" }

and so on. All the {} need to be the sort you can enter using ctrl-F9.

Peter Jamieson

"Dale" D-Man wrote in message
...

Hi All, I am resending this as I think I posted it in the wrong group
previously.


I do a lot of mail merges using MS Word. I've dealt some with field codes
and macros but this situation stumps me. Is there a way/how would I deal
with one letter first names in a salutation. For instance, if I'm trying
to
use the first name field of an individual from my data but the first and
last name looks like "D Jones" then the resulting salutation would be
"Dear
D". Obviously this is not good. I would think the answer lies in proper
use of the If-Then-Else style Word Field. Therein lies my problem. How
to
build an IF statement from looking at my data and deciding whether or not
the data is only one character long.

Can someone suggest how this may be done? I surmise possibly a Word
"compare" field might do but again, syntax gets in my way.

Help!

Regards
Dale