#1   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Shoelaces
 
Posts: n/a
Default IF Statement

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.
  #2   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Graham Mayor
 
Posts: n/a
Default IF Statement

{IF {Mergefield Sex \*lower} = "m" "he" "she"}

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


--

Graham Mayor - Word MVP

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



Shoelaces wrote:
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.



  #3   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Shoelaces
 
Posts: n/a
Default IF Statement

"Graham Mayor" wrote:
{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?
  #4   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Shoelaces
 
Posts: n/a
Default IF Statement

Got it! I needed two inserts.

Thank you kindly for your help,
  #5   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Charles Kenyon
 
Posts: n/a
Default IF Statement

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.
--
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.

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





  #6   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Graham Mayor
 
Posts: n/a
Default IF Statement

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.

--

Graham Mayor - Word MVP

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


Shoelaces wrote:
Got it! I needed two inserts.

Thank you kindly for your help,



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
Q: IF statement in table in Word JIM.H. Microsoft Word Help 1 November 5th 05 12:18 AM
Statement parameter in Mailmerge.OpenDataSource Christof Nordiek Mailmerge 6 April 26th 05 09:31 AM
Possible BUG: Multiple HTTPrequests send from one includetext statement Oliver Mailmerge 2 April 18th 05 09:46 AM
How do I copy a scanned signature into an if/or statement in Word mcgowan Mailmerge 2 February 1st 05 07:37 AM
Insert carriage return in mergefield statement dixie Mailmerge 2 December 22nd 04 04:42 AM


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