Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
Compensating for "a" and "an"
I am doing a mailmerge document and need help with a field that will
recognize whether the mergefield result begins with a consonant or a vowel. For instance the sentance might read "His pet is a cat." or "His pet is a owl. I need a field to substitute "an" for "a" when the mergefield begins with a consonant. Any ideas? |
#2
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
Compensating for "a" and "an"
I think that the only way to deal with this is to include the article in the
data source. If the data source is a Word document, this could be done using a Wildcard Replace See the article "Finding and replacing characters using wildcards" at: http://www.word.mvps.org/FAQs/Genera...gWildcards.htm If the data source is not a Word document, you could use a catalog or directory (depends on the version of Word) mailmerge to get the data source into a Word table so that Wildcard Replace could be used upon it. -- Hope this helps. Please reply to the newsgroup unless you wish to avail yourself of my services on a paid consulting basis. Doug Robbins - Word MVP "Thanks for the Help" Thanks for the wrote in message ... I am doing a mailmerge document and need help with a field that will recognize whether the mergefield result begins with a consonant or a vowel. For instance the sentance might read "His pet is a cat." or "His pet is a owl. I need a field to substitute "an" for "a" when the mergefield begins with a consonant. Any ideas? |
#3
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
Compensating for "a" and "an"
You could use nested conditional fields top test for the vowels eg
{ IF{ Mergefield Type \*lower} = "a*" "an" "{ IF{ Mergefield Type \*lower} = "e*" "an" "{ IF{ Mergefield Type \*lower} = "i*" "an" "{ IF{ Mergefield Type \*lower} = "o*" "an" "{ IF{ Mergefield Type \*lower} = "u*" "an" "a" }" }" }" }" } -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Thanks for the Help wrote: I am doing a mailmerge document and need help with a field that will recognize whether the mergefield result begins with a consonant or a vowel. For instance the sentance might read "His pet is a cat." or "His pet is a owl. I need a field to substitute "an" for "a" when the mergefield begins with a consonant. Any ideas? |
#4
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
Compensating for "a" and "an"
A simpler version of Graham's solution:
{IF{Mergefield Type \*lower} "a*" {IF{Mergefield Type \*lower} "e*" {IF{Mergefield Type \*lower} "i*" {IF{ Mergefield Type \*lower} "o*" IF{Mergefield Type \*lower} "u*" a an}}}}} If you're sure the animal types will always have lower-case letters, you could delete all the '\*lower' switches too. Cheers -- macropod [MVP - Microsoft Word] "Thanks for the Help" Thanks for the wrote in message ... I am doing a mailmerge document and need help with a field that will recognize whether the mergefield result begins with a consonant or a vowel. For instance the sentance might read "His pet is a cat." or "His pet is a owl. I need a field to substitute "an" for "a" when the mergefield begins with a consonant. Any ideas? |
#5
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
Compensating for "a" and "an"
Simpler?
I prefer to add the \*lower switch when making this type of comparison as I have been bitten too many times with unfortunate data entry (not mine). At least this way it should work whatever is entered. -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org macropod wrote: A simpler version of Graham's solution: {IF{Mergefield Type \*lower} "a*" {IF{Mergefield Type \*lower} "e*" {IF{Mergefield Type \*lower} "i*" {IF{ Mergefield Type \*lower} "o*" IF{Mergefield Type \*lower} "u*" a an}}}}} If you're sure the animal types will always have lower-case letters, you could delete all the '\*lower' switches too. Cheers "Thanks for the Help" Thanks for the wrote in message ... I am doing a mailmerge document and need help with a field that will recognize whether the mergefield result begins with a consonant or a vowel. For instance the sentance might read "His pet is a cat." or "His pet is a owl. I need a field to substitute "an" for "a" when the mergefield begins with a consonant. Any ideas? |
#6
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
Compensating for "a" and "an"
Only a single a/an result, and 20% fewer characters - mostly unnecessary
quotes & spaces. ||)} I do wonder though what the OP will do when he/she finds he/she has an hare or a ewe!! Cheers -- macropod [MVP - Microsoft Word] "Graham Mayor" wrote in message ... Simpler? I prefer to add the \*lower switch when making this type of comparison as I have been bitten too many times with unfortunate data entry (not mine). At least this way it should work whatever is entered. -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org macropod wrote: A simpler version of Graham's solution: {IF{Mergefield Type \*lower} "a*" {IF{Mergefield Type \*lower} "e*" {IF{Mergefield Type \*lower} "i*" {IF{ Mergefield Type \*lower} "o*" IF{Mergefield Type \*lower} "u*" a an}}}}} If you're sure the animal types will always have lower-case letters, you could delete all the '\*lower' switches too. Cheers "Thanks for the Help" Thanks for the wrote in message ... I am doing a mailmerge document and need help with a field that will recognize whether the mergefield result begins with a consonant or a vowel. For instance the sentance might read "His pet is a cat." or "His pet is a owl. I need a field to substitute "an" for "a" when the mergefield begins with a consonant. Any ideas? |
#7
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
Compensating for "a" and "an"
Or a holy cow?
-- Hope this helps. Please reply to the newsgroup unless you wish to avail yourself of my services on a paid consulting basis. Doug Robbins - Word MVP "macropod" wrote in message ... Only a single a/an result, and 20% fewer characters - mostly unnecessary quotes & spaces. ||)} I do wonder though what the OP will do when he/she finds he/she has an hare or a ewe!! Cheers -- macropod [MVP - Microsoft Word] "Graham Mayor" wrote in message ... Simpler? I prefer to add the \*lower switch when making this type of comparison as I have been bitten too many times with unfortunate data entry (not mine). At least this way it should work whatever is entered. -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org macropod wrote: A simpler version of Graham's solution: {IF{Mergefield Type \*lower} "a*" {IF{Mergefield Type \*lower} "e*" {IF{Mergefield Type \*lower} "i*" {IF{ Mergefield Type \*lower} "o*" IF{Mergefield Type \*lower} "u*" a an}}}}} If you're sure the animal types will always have lower-case letters, you could delete all the '\*lower' switches too. Cheers "Thanks for the Help" Thanks for the wrote in message ... I am doing a mailmerge document and need help with a field that will recognize whether the mergefield result begins with a consonant or a vowel. For instance the sentance might read "His pet is a cat." or "His pet is a owl. I need a field to substitute "an" for "a" when the mergefield begins with a consonant. Any ideas? |
#8
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
Compensating for "a" and "an"
luckily, the animals were only an example the actual field result will be
the name of a state, so I will adjust the "lower" accordingly. I knew there had to be a way to do it. Thank you guys so much for your help. By the way, I just bought a book on Word VBA. Going to try to beef up my understanding a bit. Any suggestions for a book that goes through a thorough discussion of fields and switches? "Doug Robbins - Word MVP" wrote: Or a holy cow? -- Hope this helps. Please reply to the newsgroup unless you wish to avail yourself of my services on a paid consulting basis. Doug Robbins - Word MVP "macropod" wrote in message ... Only a single a/an result, and 20% fewer characters - mostly unnecessary quotes & spaces. ||)} I do wonder though what the OP will do when he/she finds he/she has an hare or a ewe!! Cheers -- macropod [MVP - Microsoft Word] "Graham Mayor" wrote in message ... Simpler? I prefer to add the \*lower switch when making this type of comparison as I have been bitten too many times with unfortunate data entry (not mine). At least this way it should work whatever is entered. -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org macropod wrote: A simpler version of Graham's solution: {IF{Mergefield Type \*lower} "a*" {IF{Mergefield Type \*lower} "e*" {IF{Mergefield Type \*lower} "i*" {IF{ Mergefield Type \*lower} "o*" IF{Mergefield Type \*lower} "u*" a an}}}}} If you're sure the animal types will always have lower-case letters, you could delete all the '\*lower' switches too. Cheers "Thanks for the Help" Thanks for the wrote in message ... I am doing a mailmerge document and need help with a field that will recognize whether the mergefield result begins with a consonant or a vowel. For instance the sentance might read "His pet is a cat." or "His pet is a owl. I need a field to substitute "an" for "a" when the mergefield begins with a consonant. Any ideas? |
#9
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
Compensating for "a" and "an"
No book - but see http://www.gmayor.com/formatting_word_fields.htm
-- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Thanks for the Help wrote: luckily, the animals were only an example the actual field result will be the name of a state, so I will adjust the "lower" accordingly. I knew there had to be a way to do it. Thank you guys so much for your help. By the way, I just bought a book on Word VBA. Going to try to beef up my understanding a bit. Any suggestions for a book that goes through a thorough discussion of fields and switches? "Doug Robbins - Word MVP" wrote: Or a holy cow? -- Hope this helps. Please reply to the newsgroup unless you wish to avail yourself of my services on a paid consulting basis. Doug Robbins - Word MVP "macropod" wrote in message ... Only a single a/an result, and 20% fewer characters - mostly unnecessary quotes & spaces. ||)} I do wonder though what the OP will do when he/she finds he/she has an hare or a ewe!! Cheers -- macropod [MVP - Microsoft Word] "Graham Mayor" wrote in message ... Simpler? I prefer to add the \*lower switch when making this type of comparison as I have been bitten too many times with unfortunate data entry (not mine). At least this way it should work whatever is entered. -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org macropod wrote: A simpler version of Graham's solution: {IF{Mergefield Type \*lower} "a*" {IF{Mergefield Type \*lower} "e*" {IF{Mergefield Type \*lower} "i*" {IF{ Mergefield Type \*lower} "o*" IF{Mergefield Type \*lower} "u*" a an}}}}} If you're sure the animal types will always have lower-case letters, you could delete all the '\*lower' switches too. Cheers "Thanks for the Help" Thanks for the wrote in message ... I am doing a mailmerge document and need help with a field that will recognize whether the mergefield result begins with a consonant or a vowel. For instance the sentance might read "His pet is a cat." or "His pet is a owl. I need a field to substitute "an" for "a" when the mergefield begins with a consonant. Any ideas? |
#10
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
Compensating for "a" and "an"
And fellow MVP, macropod's tutorial at:
http://www.wopr.com/cgi-bin/w3t/show...?Number=249902 -- Hope this helps. Please reply to the newsgroup unless you wish to avail yourself of my services on a paid consulting basis. Doug Robbins - Word MVP "Thanks for the Help" wrote in message ... luckily, the animals were only an example the actual field result will be the name of a state, so I will adjust the "lower" accordingly. I knew there had to be a way to do it. Thank you guys so much for your help. By the way, I just bought a book on Word VBA. Going to try to beef up my understanding a bit. Any suggestions for a book that goes through a thorough discussion of fields and switches? "Doug Robbins - Word MVP" wrote: Or a holy cow? -- Hope this helps. Please reply to the newsgroup unless you wish to avail yourself of my services on a paid consulting basis. Doug Robbins - Word MVP "macropod" wrote in message ... Only a single a/an result, and 20% fewer characters - mostly unnecessary quotes & spaces. ||)} I do wonder though what the OP will do when he/she finds he/she has an hare or a ewe!! Cheers -- macropod [MVP - Microsoft Word] "Graham Mayor" wrote in message ... Simpler? I prefer to add the \*lower switch when making this type of comparison as I have been bitten too many times with unfortunate data entry (not mine). At least this way it should work whatever is entered. -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org macropod wrote: A simpler version of Graham's solution: {IF{Mergefield Type \*lower} "a*" {IF{Mergefield Type \*lower} "e*" {IF{Mergefield Type \*lower} "i*" {IF{ Mergefield Type \*lower} "o*" IF{Mergefield Type \*lower} "u*" a an}}}}} If you're sure the animal types will always have lower-case letters, you could delete all the '\*lower' switches too. Cheers "Thanks for the Help" Thanks for the wrote in message ... I am doing a mailmerge document and need help with a field that will recognize whether the mergefield result begins with a consonant or a vowel. For instance the sentance might read "His pet is a cat." or "His pet is a owl. I need a field to substitute "an" for "a" when the mergefield begins with a consonant. Any ideas? |
#11
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
Compensating for "a" and "an"
Doug's pointed you to my date calculations 'tutorial. I've also got another
'tutorial' - on Word field maths - at: http://www.wopr.com/cgi-bin/w3t/show...?Number=365442 with plenty of examples of what can be done with just a few of the field switches. Cheers -- macropod [MVP - Microsoft Word] "Thanks for the Help" wrote in message ... luckily, the animals were only an example the actual field result will be the name of a state, so I will adjust the "lower" accordingly. I knew there had to be a way to do it. Thank you guys so much for your help. By the way, I just bought a book on Word VBA. Going to try to beef up my understanding a bit. Any suggestions for a book that goes through a thorough discussion of fields and switches? "Doug Robbins - Word MVP" wrote: Or a holy cow? -- Hope this helps. Please reply to the newsgroup unless you wish to avail yourself of my services on a paid consulting basis. Doug Robbins - Word MVP "macropod" wrote in message ... Only a single a/an result, and 20% fewer characters - mostly unnecessary quotes & spaces. ||)} I do wonder though what the OP will do when he/she finds he/she has an hare or a ewe!! Cheers -- macropod [MVP - Microsoft Word] "Graham Mayor" wrote in message ... Simpler? I prefer to add the \*lower switch when making this type of comparison as I have been bitten too many times with unfortunate data entry (not mine). At least this way it should work whatever is entered. -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org macropod wrote: A simpler version of Graham's solution: {IF{Mergefield Type \*lower} "a*" {IF{Mergefield Type \*lower} "e*" {IF{Mergefield Type \*lower} "i*" {IF{ Mergefield Type \*lower} "o*" IF{Mergefield Type \*lower} "u*" a an}}}}} If you're sure the animal types will always have lower-case letters, you could delete all the '\*lower' switches too. Cheers "Thanks for the Help" Thanks for the wrote in message ... I am doing a mailmerge document and need help with a field that will recognize whether the mergefield result begins with a consonant or a vowel. For instance the sentance might read "His pet is a cat." or "His pet is a owl. I need a field to substitute "an" for "a" when the mergefield begins with a consonant. Any ideas? |
#12
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
Compensating for "a" and "an"
One of them is enough to "blow your mind".
-- Hope this helps. Please reply to the newsgroup unless you wish to avail yourself of my services on a paid consulting basis. Doug Robbins - Word MVP "macropod" wrote in message ... Doug's pointed you to my date calculations 'tutorial. I've also got another 'tutorial' - on Word field maths - at: http://www.wopr.com/cgi-bin/w3t/show...?Number=365442 with plenty of examples of what can be done with just a few of the field switches. Cheers -- macropod [MVP - Microsoft Word] "Thanks for the Help" wrote in message ... luckily, the animals were only an example the actual field result will be the name of a state, so I will adjust the "lower" accordingly. I knew there had to be a way to do it. Thank you guys so much for your help. By the way, I just bought a book on Word VBA. Going to try to beef up my understanding a bit. Any suggestions for a book that goes through a thorough discussion of fields and switches? "Doug Robbins - Word MVP" wrote: Or a holy cow? -- Hope this helps. Please reply to the newsgroup unless you wish to avail yourself of my services on a paid consulting basis. Doug Robbins - Word MVP "macropod" wrote in message ... Only a single a/an result, and 20% fewer characters - mostly unnecessary quotes & spaces. ||)} I do wonder though what the OP will do when he/she finds he/she has an hare or a ewe!! Cheers -- macropod [MVP - Microsoft Word] "Graham Mayor" wrote in message ... Simpler? I prefer to add the \*lower switch when making this type of comparison as I have been bitten too many times with unfortunate data entry (not mine). At least this way it should work whatever is entered. -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org macropod wrote: A simpler version of Graham's solution: {IF{Mergefield Type \*lower} "a*" {IF{Mergefield Type \*lower} "e*" {IF{Mergefield Type \*lower} "i*" {IF{ Mergefield Type \*lower} "o*" IF{Mergefield Type \*lower} "u*" a an}}}}} If you're sure the animal types will always have lower-case letters, you could delete all the '\*lower' switches too. Cheers "Thanks for the Help" Thanks for the wrote in message ... I am doing a mailmerge document and need help with a field that will recognize whether the mergefield result begins with a consonant or a vowel. For instance the sentance might read "His pet is a cat." or "His pet is a owl. I need a field to substitute "an" for "a" when the mergefield begins with a consonant. Any ideas? |
#13
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
Compensating for "a" and "an"
Don't you just hate this man
I have added a link to that tutorial on my http://www.gmayor.com/formatting_word_fields.htm page. Great stuff! -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Doug Robbins - Word MVP wrote: One of them is enough to "blow your mind". "macropod" wrote in message ... Doug's pointed you to my date calculations 'tutorial. I've also got another 'tutorial' - on Word field maths - at: http://www.wopr.com/cgi-bin/w3t/show...?Number=365442 with plenty of examples of what can be done with just a few of the field switches. Cheers -- macropod [MVP - Microsoft Word] "Thanks for the Help" wrote in message ... luckily, the animals were only an example the actual field result will be the name of a state, so I will adjust the "lower" accordingly. I knew there had to be a way to do it. Thank you guys so much for your help. By the way, I just bought a book on Word VBA. Going to try to beef up my understanding a bit. Any suggestions for a book that goes through a thorough discussion of fields and switches? "Doug Robbins - Word MVP" wrote: Or a holy cow? -- Hope this helps. Please reply to the newsgroup unless you wish to avail yourself of my services on a paid consulting basis. Doug Robbins - Word MVP "macropod" wrote in message ... Only a single a/an result, and 20% fewer characters - mostly unnecessary quotes & spaces. ||)} I do wonder though what the OP will do when he/she finds he/she has an hare or a ewe!! Cheers -- macropod [MVP - Microsoft Word] "Graham Mayor" wrote in message ... Simpler? I prefer to add the \*lower switch when making this type of comparison as I have been bitten too many times with unfortunate data entry (not mine). At least this way it should work whatever is entered. -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org macropod wrote: A simpler version of Graham's solution: {IF{Mergefield Type \*lower} "a*" {IF{Mergefield Type \*lower} "e*" {IF{Mergefield Type \*lower} "i*" {IF{ Mergefield Type \*lower} "o*" IF{Mergefield Type \*lower} "u*" a an}}}}} If you're sure the animal types will always have lower-case letters, you could delete all the '\*lower' switches too. Cheers "Thanks for the Help" Thanks for the wrote in message ... I am doing a mailmerge document and need help with a field that will recognize whether the mergefield result begins with a consonant or a vowel. For instance the sentance might read "His pet is a cat." or "His pet is a owl. I need a field to substitute "an" for "a" when the mergefield begins with a consonant. Any ideas? |
#14
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
Compensating for "a" and "an"
Thanks guys,
Nice to be appreciated. Cheers -- macropod [MVP - Microsoft Word] "Graham Mayor" wrote in message ... Don't you just hate this man I have added a link to that tutorial on my http://www.gmayor.com/formatting_word_fields.htm page. Great stuff! -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Doug Robbins - Word MVP wrote: One of them is enough to "blow your mind". "macropod" wrote in message ... Doug's pointed you to my date calculations 'tutorial. I've also got another 'tutorial' - on Word field maths - at: http://www.wopr.com/cgi-bin/w3t/show...?Number=365442 with plenty of examples of what can be done with just a few of the field switches. Cheers -- macropod [MVP - Microsoft Word] "Thanks for the Help" wrote in message ... luckily, the animals were only an example the actual field result will be the name of a state, so I will adjust the "lower" accordingly. I knew there had to be a way to do it. Thank you guys so much for your help. By the way, I just bought a book on Word VBA. Going to try to beef up my understanding a bit. Any suggestions for a book that goes through a thorough discussion of fields and switches? "Doug Robbins - Word MVP" wrote: Or a holy cow? -- Hope this helps. Please reply to the newsgroup unless you wish to avail yourself of my services on a paid consulting basis. Doug Robbins - Word MVP "macropod" wrote in message ... Only a single a/an result, and 20% fewer characters - mostly unnecessary quotes & spaces. ||)} I do wonder though what the OP will do when he/she finds he/she has an hare or a ewe!! Cheers -- macropod [MVP - Microsoft Word] "Graham Mayor" wrote in message ... Simpler? I prefer to add the \*lower switch when making this type of comparison as I have been bitten too many times with unfortunate data entry (not mine). At least this way it should work whatever is entered. -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org macropod wrote: A simpler version of Graham's solution: {IF{Mergefield Type \*lower} "a*" {IF{Mergefield Type \*lower} "e*" {IF{Mergefield Type \*lower} "i*" {IF{ Mergefield Type \*lower} "o*" IF{Mergefield Type \*lower} "u*" a an}}}}} If you're sure the animal types will always have lower-case letters, you could delete all the '\*lower' switches too. Cheers "Thanks for the Help" Thanks for the wrote in message ... I am doing a mailmerge document and need help with a field that will recognize whether the mergefield result begins with a consonant or a vowel. For instance the sentance might read "His pet is a cat." or "His pet is a owl. I need a field to substitute "an" for "a" when the mergefield begins with a consonant. Any ideas? |
#15
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
Compensating for "a" and "an"
I've taken my cue from you and added links to my
http://addbalance.com/word/download.htm and http://addbalance.com/usersguide/fields.htm pages. These documents are great resources. -- Charles Kenyon Word New User FAQ & Web Directory: http://addbalance.com/word Intermediate User's Guide to Microsoft Word (supplemented version of Microsoft's Legal Users' Guide) http://addbalance.com/usersguide See also the MVP FAQ: http://word.mvps.org/FAQs/ which is awesome! My criminal defense site: http://addbalance.com --------- --------- --------- --------- --------- --------- This message is posted to a newsgroup. Please post replies and questions to the newsgroup so that others can learn from my ignorance and your wisdom. "Graham Mayor" wrote in message ... Don't you just hate this man I have added a link to that tutorial on my http://www.gmayor.com/formatting_word_fields.htm page. Great stuff! -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Doug Robbins - Word MVP wrote: One of them is enough to "blow your mind". "macropod" wrote in message ... Doug's pointed you to my date calculations 'tutorial. I've also got another 'tutorial' - on Word field maths - at: http://www.wopr.com/cgi-bin/w3t/show...?Number=365442 with plenty of examples of what can be done with just a few of the field switches. Cheers -- macropod [MVP - Microsoft Word] "Thanks for the Help" wrote in message ... luckily, the animals were only an example the actual field result will be the name of a state, so I will adjust the "lower" accordingly. I knew there had to be a way to do it. Thank you guys so much for your help. By the way, I just bought a book on Word VBA. Going to try to beef up my understanding a bit. Any suggestions for a book that goes through a thorough discussion of fields and switches? "Doug Robbins - Word MVP" wrote: Or a holy cow? -- Hope this helps. Please reply to the newsgroup unless you wish to avail yourself of my services on a paid consulting basis. Doug Robbins - Word MVP "macropod" wrote in message ... Only a single a/an result, and 20% fewer characters - mostly unnecessary quotes & spaces. ||)} I do wonder though what the OP will do when he/she finds he/she has an hare or a ewe!! Cheers -- macropod [MVP - Microsoft Word] "Graham Mayor" wrote in message ... Simpler? I prefer to add the \*lower switch when making this type of comparison as I have been bitten too many times with unfortunate data entry (not mine). At least this way it should work whatever is entered. -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org macropod wrote: A simpler version of Graham's solution: {IF{Mergefield Type \*lower} "a*" {IF{Mergefield Type \*lower} "e*" {IF{Mergefield Type \*lower} "i*" {IF{ Mergefield Type \*lower} "o*" IF{Mergefield Type \*lower} "u*" a an}}}}} If you're sure the animal types will always have lower-case letters, you could delete all the '\*lower' switches too. Cheers "Thanks for the Help" Thanks for the wrote in message ... I am doing a mailmerge document and need help with a field that will recognize whether the mergefield result begins with a consonant or a vowel. For instance the sentance might read "His pet is a cat." or "His pet is a owl. I need a field to substitute "an" for "a" when the mergefield begins with a consonant. Any ideas? |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
The use of fields for the correct use "a" or "an" | Microsoft Word Help |