Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Dale
 
Posts: n/a
Default One Letter Names in Salutation


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



  #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





  #3   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Dale
 
Posts: n/a
Default One Letter Names in Salutation

Thanx Peter.

Syntax is everything.

I was aware of the ? as a wildcard from DOS days but it never occurred to
me. I think I'll combine this with COMPARE to check and see if the field is
also empty. If empty then I usually have the data clean enough to do
something like "Dear Mr Jones"

I appreciate the help.


"Peter Jamieson" wrote in message
...
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







  #4   Report Post  
Posted to microsoft.public.word.mailmerge.fields
 
Posts: n/a
Default One Letter Names in Salutation

There is also the issue of the data itself. Which may not be your
answer for this moment in time, but any database I handle that will be
used for mailings has a "salutation" field to avoid exactly this kind
of coding. The more you have to code to look for anomalies, the more
there is chance for undesired results. For example, very often the
data recorded in the first name field will be appropriate for a mailing
label, but something more familiar might be desired for the salutation.
I see this all the time with the organizations I work with. I realize
that right now you have to produce results with the data that you have,
but planning your table structures and data collection methods to
include this can really help in the future.

Betsy

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
Gender neutral salutation for business letter? Donclare Microsoft Word Help 4 March 9th 06 09:50 PM
merge letter with drop down form field Sarah Mailmerge 2 January 24th 06 11:33 PM
How do I put multiple names in one letter? Shaun Microsoft Word Help 1 August 11th 05 08:57 PM
Convert to Symbols Omar Menjivar Microsoft Word Help 7 June 27th 05 07:32 PM
Can't save merged form letter... Raven Mailmerge 1 January 27th 05 08:34 PM


All times are GMT +1. The time now is 03:30 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"