Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Mailmerge and Fax / June 2006

Tip: Looking for answers? Try searching our database.

Compensating for "a" and "an"

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Thanks for the Help - 22 Jun 2006 04:15 GMT
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?
Doug Robbins - Word MVP - 22 Jun 2006 04:41 GMT
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/General/UsingWildcards.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.

Signature

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

>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
[quoted text clipped - 4 lines]
> a <<owl>>.  I need a field to substitute "an" for "a" when the mergefield
> begins with a consonant.  Any ideas?
Graham Mayor - 22 Jun 2006 06:40 GMT
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" }" }" }" }" }

Signature

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor -  Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>

> 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
[quoted text clipped - 3 lines]
> pet is a <<owl>>.  I need a field to substitute "an" for "a" when the
> mergefield begins with a consonant.  Any ideas?
macropod - 22 Jun 2006 10:45 GMT
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

Signature

macropod
[MVP - Microsoft Word]

> 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?
Graham Mayor - 22 Jun 2006 11:48 GMT
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.

Signature

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor -  Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>

> A simpler version of Graham's solution:
> {IF{Mergefield Type \*lower}<> "a*" {IF{Mergefield Type \*lower}<>
[quoted text clipped - 13 lines]
>> pet is a <<owl>>.  I need a field to substitute "an" for "a" when
>> the mergefield begins with a consonant.  Any ideas?
macropod - 22 Jun 2006 13:29 GMT
Only a single a/an result, and 20% fewer characters - mostly unnecessary
quotes & spaces. ||:o)}

I do wonder though what the OP will do when he/she finds he/she has an hare
or a ewe!!

Cheers

Signature

macropod
[MVP - Microsoft Word]

> Simpler? ;)
>
[quoted text clipped - 19 lines]
> >> pet is a <<owl>>.  I need a field to substitute "an" for "a" when
> >> the mergefield begins with a consonant.  Any ideas?
Doug Robbins - Word MVP - 22 Jun 2006 13:52 GMT
Or a holy cow?

Signature

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

> Only a single a/an result, and 20% fewer characters - mostly unnecessary
> quotes & spaces. ||:o)}
[quoted text clipped - 30 lines]
>> >> pet is a <<owl>>.  I need a field to substitute "an" for "a" when
>> >> the mergefield begins with a consonant.  Any ideas?
Thanks for the Help - 25 Jun 2006 03:56 GMT
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?

> Or a holy cow?
>
[quoted text clipped - 32 lines]
> >> >> pet is a <<owl>>.  I need a field to substitute "an" for "a" when
> >> >> the mergefield begins with a consonant.  Any ideas?
Graham Mayor - 25 Jun 2006 05:57 GMT
No book - but see http://www.gmayor.com/formatting_word_fields.htm

Signature

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor -  Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>

> luckily, the animals were only an example :)  the actual field result
> will be the name of a state, so I will adjust the "lower"
[quoted text clipped - 60 lines]
>>>>>> "His pet is a <<owl>>.  I need a field to substitute "an" for
>>>>>> "a" when the mergefield begins with a consonant.  Any ideas?
Doug Robbins - Word MVP - 25 Jun 2006 07:05 GMT
And fellow MVP, macropod's tutorial at:

http://www.wopr.com/cgi-bin/w3t/showthreaded.pl?Number=249902

Signature

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

> luckily, the animals were only an example :)  the actual field result will
> be
[quoted text clipped - 53 lines]
>> >> >> pet is a <<owl>>.  I need a field to substitute "an" for "a" when
>> >> >> the mergefield begins with a consonant.  Any ideas?
macropod - 26 Jun 2006 12:24 GMT
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/showthreaded.pl?Number=365442
with plenty of examples of what can be done with just a few of the field
switches.

Cheers

Signature

macropod
[MVP - Microsoft Word]

> 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
[quoted text clipped - 40 lines]
> > >> >> pet is a <<owl>>.  I need a field to substitute "an" for "a" when
> > >> >> the mergefield begins with a consonant.  Any ideas?
Doug Robbins - Word MVP - 26 Jun 2006 18:45 GMT
One of them is enough to "blow your mind".

Signature

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

> Doug's pointed you to my date calculations 'tutorial. I've also got
> another
[quoted text clipped - 66 lines]
>> > >> >> pet is a <<owl>>.  I need a field to substitute "an" for "a" when
>> > >> >> the mergefield begins with a consonant.  Any ideas?
Graham Mayor - 27 Jun 2006 09:50 GMT
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!

Signature

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor -  Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>

> One of them is enough to "blow your mind".
>
[quoted text clipped - 84 lines]
>>>>>>>> for "a" when the mergefield begins with a consonant.  Any
>>>>>>>> ideas?
macropod - 29 Jun 2006 12:44 GMT
Thanks guys,

Nice to be appreciated.

Cheers

Signature

macropod
[MVP - Microsoft Word]

> Don't you just hate this man ;)
> I have added a link to that tutorial on my
[quoted text clipped - 88 lines]
> >>>>>>>> for "a" when the mergefield begins with a consonant.  Any
> >>>>>>>> ideas?
Charles Kenyon - 29 Jun 2006 14:14 GMT
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.

Signature

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.

> Don't you just hate this man ;)
> I have added a link to that tutorial on my
[quoted text clipped - 88 lines]
>>>>>>>>> for "a" when the mergefield begins with a consonant.  Any
>>>>>>>>> ideas?

Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.