Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Kelly
 
Posts: n/a
Default Using an If Statement

I'm using Word 2003 and Windows XP. I have a merge document setup and one of
the fields is for the salutation. What I need to happen at the merge is when
it comes to the salutation field, if it is blank then look to another field I
have. so the statement should look something like this:

if salutation1=blank,salutation2,salutation1

However, I cannot figure out how to get that statement in my document. Any
help would be appreciated.
--
I appreciate your time,

Kelly
  #2   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Charles Kenyon
 
Posts: n/a
Default Using an If Statement

{ if salutation1 = "" "salutation2" "salutation1" }
--
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.

"Kelly" wrote in message
...
I'm using Word 2003 and Windows XP. I have a merge document setup and one
of
the fields is for the salutation. What I need to happen at the merge is
when
it comes to the salutation field, if it is blank then look to another
field I
have. so the statement should look something like this:

if salutation1=blank,salutation2,salutation1

However, I cannot figure out how to get that statement in my document.
Any
help would be appreciated.
--
I appreciate your time,

Kelly



  #3   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Graham Mayor
 
Posts: n/a
Default Using an If Statement

Doug is correct, but he does have a tendency to assume a level of knowledge
that the questioner may not have, and in this case I think you may be
stretched to work out what he meant here.

Press CTRL+F9 directly in the document, which will give you {}
Between the brackets type the text and insert the fields as he has shown, or
if you prefer manually type in the fields with CTRL+F9 for each pair of
boundaries {}
Thus
{IF {Mergefield Title} = "" "{Mergefield Salutation2}" "{Mergefield
Salutation1}"}
Then with the cursor in the field press F9 to update. This should also
switch the display.

--

Graham Mayor - Word MVP

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


Kelly wrote:
I'm using Word 2003 and Windows XP. I have a merge document setup
and one of the fields is for the salutation. What I need to happen
at the merge is when it comes to the salutation field, if it is blank
then look to another field I have. so the statement should look
something like this:

if salutation1=blank,salutation2,salutation1

However, I cannot figure out how to get that statement in my
document. Any help would be appreciated.




  #4   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Doug Robbins - Word MVP
 
Posts: n/a
Default Using an If Statement

I guess in this case you meant Charles.g

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

"Graham Mayor" wrote in message
...
Doug is correct, but he does have a tendency to assume a level of
knowledge
that the questioner may not have, and in this case I think you may be
stretched to work out what he meant here.

Press CTRL+F9 directly in the document, which will give you {}
Between the brackets type the text and insert the fields as he has shown,
or
if you prefer manually type in the fields with CTRL+F9 for each pair of
boundaries {}
Thus
{IF {Mergefield Title} = "" "{Mergefield Salutation2}" "{Mergefield
Salutation1}"}
Then with the cursor in the field press F9 to update. This should also
switch the display.

--

Graham Mayor - Word MVP

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


Kelly wrote:
I'm using Word 2003 and Windows XP. I have a merge document setup
and one of the fields is for the salutation. What I need to happen
at the merge is when it comes to the salutation field, if it is blank
then look to another field I have. so the statement should look
something like this:

if salutation1=blank,salutation2,salutation1

However, I cannot figure out how to get that statement in my
document. Any help would be appreciated.






  #5   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Graham Mayor
 
Posts: n/a
Default Using an If Statement

Oops - a senior moment
I don't know why I wrote Doug there. Apologies

--

Graham Mayor - Word MVP

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


Doug Robbins - Word MVP wrote:
I guess in this case you meant Charles.g


"Graham Mayor" wrote in message
...
Doug is correct, but he does have a tendency to assume a level of
knowledge
that the questioner may not have, and in this case I think you may be
stretched to work out what he meant here.

Press CTRL+F9 directly in the document, which will give you {}
Between the brackets type the text and insert the fields as he has
shown, or
if you prefer manually type in the fields with CTRL+F9 for each pair
of boundaries {}
Thus
{IF {Mergefield Title} = "" "{Mergefield Salutation2}" "{Mergefield
Salutation1}"}
Then with the cursor in the field press F9 to update. This should
also switch the display.

--

Graham Mayor - Word MVP

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


Kelly wrote:
I'm using Word 2003 and Windows XP. I have a merge document setup
and one of the fields is for the salutation. What I need to happen
at the merge is when it comes to the salutation field, if it is
blank then look to another field I have. so the statement should
look something like this:

if salutation1=blank,salutation2,salutation1

However, I cannot figure out how to get that statement in my
document. Any help would be appreciated.






  #6   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Amber Amber is offline
external usenet poster
 
Posts: 2
Default Using an If Statement

I am trying to do this it is not working for me. this is what I typed
{IF{Nickname}=blank,{First Name},{Nickname}} can you tell me what I am doing
wrong please?

Thank you

"Graham Mayor" wrote:

Doug is correct, but he does have a tendency to assume a level of knowledge
that the questioner may not have, and in this case I think you may be
stretched to work out what he meant here.

Press CTRL+F9 directly in the document, which will give you {}
Between the brackets type the text and insert the fields as he has shown, or
if you prefer manually type in the fields with CTRL+F9 for each pair of
boundaries {}
Thus
{IF {Mergefield Title} = "" "{Mergefield Salutation2}" "{Mergefield
Salutation1}"}
Then with the cursor in the field press F9 to update. This should also
switch the display.

--

Graham Mayor - Word MVP

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


Kelly wrote:
I'm using Word 2003 and Windows XP. I have a merge document setup
and one of the fields is for the salutation. What I need to happen
at the merge is when it comes to the salutation field, if it is blank
then look to another field I have. so the statement should look
something like this:

if salutation1=blank,salutation2,salutation1

However, I cannot figure out how to get that statement in my
document. Any help would be appreciated.





  #7   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Jamieson Peter Jamieson is offline
external usenet poster
 
Posts: 4,582
Default Using an If Statement

1. let's try to go step by step.

The overview is that
a. your fields need to look like

{ IF "{ Nickname }" = "" "{ First Name }" "{ Nickname }" }

b. each pair of braces ( "{}" ) in there need to be the special field
braces that you can enter using ctrl-F9, not just the { and } characters you
can type on your keyboard. So e.g. you can do
ctrl-F9 to give you
{ }
then click inside those {} and type
IF "" = "" "" ""
to give you
{ IF "" = "" "" "" }

Then click between the first pair of "" and use ctrl-F9 again to give you

{ IF "{ }" = "" "" "" }

Then click inside the inner {} and type
Nickname

so you have

{ IF "{ Nickname }" = "" "" "" }

See where I'm going? Each pair of {} needs to be inserted using ctrl-F9.
Everything else is text you can enter on the keyboard. Also, you can use
Alt-F9 to "toggle" between a view where you see the field codes, or the
results of those field codes.

2. if your "Nickname" and "First Name" are actually columns in a mail merge
data source, then what you probably need is

{ IF "{ MERGEFIELD Nickname }" = "" "{ MERGEFIELD "First Name" }" "{
MERGEFIELD Nickname }" }

--
Peter Jamieson
http://tips.pjmsn.me.uk

"Amber" Amber @discussions.microsoft.com wrote in message
...
I am trying to do this it is not working for me. this is what I typed
{IF{Nickname}=blank,{First Name},{Nickname}} can you tell me what I am
doing
wrong please?

Thank you

"Graham Mayor" wrote:

Doug is correct, but he does have a tendency to assume a level of
knowledge
that the questioner may not have, and in this case I think you may be
stretched to work out what he meant here.

Press CTRL+F9 directly in the document, which will give you {}
Between the brackets type the text and insert the fields as he has shown,
or
if you prefer manually type in the fields with CTRL+F9 for each pair of
boundaries {}
Thus
{IF {Mergefield Title} = "" "{Mergefield Salutation2}" "{Mergefield
Salutation1}"}
Then with the cursor in the field press F9 to update. This should also
switch the display.

--

Graham Mayor - Word MVP

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


Kelly wrote:
I'm using Word 2003 and Windows XP. I have a merge document setup
and one of the fields is for the salutation. What I need to happen
at the merge is when it comes to the salutation field, if it is blank
then look to another field I have. so the statement should look
something like this:

if salutation1=blank,salutation2,salutation1

However, I cannot figure out how to get that statement in my
document. Any help would be appreciated.






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 4th 05 11:18 PM
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 06:37 AM
Insert carriage return in mergefield statement dixie Mailmerge 2 December 22nd 04 03:42 AM


All times are GMT +1. The time now is 10:57 PM.

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"