Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
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
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
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
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
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
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
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 | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Gender neutral salutation for business letter? | Microsoft Word Help | |||
merge letter with drop down form field | Mailmerge | |||
How do I put multiple names in one letter? | Microsoft Word Help | |||
Convert to Symbols | Microsoft Word Help | |||
Can't save merged form letter... | Mailmerge |