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 / November 2005

Tip: Looking for answers? Try searching our database.

IF Statement

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Shoelaces - 22 Nov 2005 14:52 GMT
I must not understand the construct of IF statements in a mail merge.

I have a Word document (2003) set up as a mail merge from an Access (2003)
database.  The records pull contain a field "Sex".  The value of that field
is either "M" or "F".

I would like to have the Word document have a sentence such as:
<<First>> has been recognized because because of his/her blah blah blah.

Instead of "he/she", I would like either "he" or "she".

Looking at:
http://support.microsoft.com/?kbid=214827

it appears the structure is:
{if {Sex}= "M" "he" {if {Sex}= "F" "she"}"}

Yet, that does not merge anything.

So, now I am not certain what to do.  I would appreciate your help with this.
Graham Mayor - 22 Nov 2005 15:05 GMT
{IF {Mergefield Sex \*lower} = "m" "he" "she"}

will do the trick. Field boundaries are inserted with CTRL+F9. The rest is
typed.

Signature

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

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

> I must not understand the construct of IF statements in a mail merge.
>
[quoted text clipped - 18 lines]
> So, now I am not certain what to do.  I would appreciate your help
> with this.
Shoelaces - 22 Nov 2005 15:27 GMT
> {IF {Mergefield Sex \*lower} = "m" "he" "she"}
>
> will do the trick. Field boundaries are inserted with CTRL+F9. The rest is
> typed.

Thank you.  I am confused by what is typed and what is inserted.

I have tried many combinations and have not produced a working solution.  
May I bother you to explain what to type before I click CTRL+F9?
Shoelaces - 22 Nov 2005 15:48 GMT
Got it!  I needed two inserts.

Thank you kindly for your help,
Graham Mayor - 23 Nov 2005 06:54 GMT
You don't need to 'insert' anything, and if you try a more complex
conditional field you will not be able to insert into the dialog boxes.
Build the fields by hand. Type CTRL+F9 which will give you {} then between
the brackets type the rest as I have listed it (with CTRL+F9 for the second
pair of brackets.) If you select a piece of text eg Mergefield Sex before
pressing CTRL+F9, that key combination will put the brackets round the
selected text.

Signature

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

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

> Got it!  I needed two inserts.
>
> Thank you kindly for your help,
Charles Kenyon - 22 Nov 2005 20:46 GMT
If you want a fairly complete set of IF field for gender-specific words, see
the Gender Add-In at http://addbalance.com/word/download.htm. While that
uses tests for a Document Property rather than a merge variable, I would
think the fields would be readily adaptable.
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!
--------- --------- --------- --------- --------- ---------
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.

>I must not understand the construct of IF statements in a mail merge.
>
[quoted text clipped - 18 lines]
> So, now I am not certain what to do.  I would appreciate your help with
> this.
 
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.