Reply
 
Thread Tools Display Modes
  #1   Report Post  
Smokey smith
 
Posts: n/a
Default conditional if statements

I am producing a marketing letter that will go to a range of organisations. I
have a field in the data table that identified the organisationtype and use
syntax similar to
{if {MERGEFIELD organisationtype} = "school" "then insert this text" 'else
insert this text."}

When I run the merge I get the the field code but not the text I want. What
am I doing incorrectly?
  #2   Report Post  
Charles Kenyon
 
Posts: n/a
Default

Try:
{IF "{MERGEFIELD organisationtype}" = "school" "true text" "false text."}

I've found that putting the quotation marks around the merge field makes IF
fields work better. May be superstition on my part, I haven't tested it in
years. I just do it.
--
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://www.mvps.org/word 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.

"Smokey smith" wrote in message
...
I am producing a marketing letter that will go to a range of organisations.
I
have a field in the data table that identified the organisationtype and
use
syntax similar to
{if {MERGEFIELD organisationtype} = "school" "then insert this text" 'else
insert this text."}

When I run the merge I get the the field code but not the text I want.
What
am I doing incorrectly?



  #3   Report Post  
Peter Jamieson
 
Posts: n/a
Default

Are the {} all the special field braces you can get by pressing ctrl-F9?

Does the result of the organisationtype MERGEFIELD exactly match "school"
(all lower case etc.) ?

Peter Jamieson
"Smokey smith" wrote in message
...
I am producing a marketing letter that will go to a range of organisations.
I
have a field in the data table that identified the organisationtype and
use
syntax similar to
{if {MERGEFIELD organisationtype} = "school" "then insert this text" 'else
insert this text."}

When I run the merge I get the the field code but not the text I want.
What
am I doing incorrectly?



  #4   Report Post  
Peter Jamieson
 
Posts: n/a
Default

I've found that putting the quotation marks around the merge field makes
IF fields work better. May be superstition on my part, I haven't tested it
in years. I just do it.


It's a good defensive programming practice, particularly sice the "field
language" is not comprehensively specified. There are definitely occasions
when it makes a difference - there have been one or two examples in the
group in the past few months but I forget exactly what they were :-)

Peter Jamieson


"Charles Kenyon" wrote in
message ...
Try:
{IF "{MERGEFIELD organisationtype}" = "school" "true text" "false text."}

I've found that putting the quotation marks around the merge field makes
IF fields work better. May be superstition on my part, I haven't tested it
in years. I just do it.
--
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://www.mvps.org/word 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.

"Smokey smith" wrote in message
...
I am producing a marketing letter that will go to a range of
organisations. I
have a field in the data table that identified the organisationtype and
use
syntax similar to
{if {MERGEFIELD organisationtype} = "school" "then insert this text"
'else
insert this text."}

When I run the merge I get the the field code but not the text I want.
What
am I doing incorrectly?





  #5   Report Post  
Smokey smith
 
Posts: n/a
Default

Oops no.... that solved the problem Thank you for your prompt reply

"Peter Jamieson" wrote:

Are the {} all the special field braces you can get by pressing ctrl-F9?

Does the result of the organisationtype MERGEFIELD exactly match "school"
(all lower case etc.) ?

Peter Jamieson
"Smokey smith" wrote in message
...
I am producing a marketing letter that will go to a range of organisations.
I
have a field in the data table that identified the organisationtype and
use
syntax similar to
{if {MERGEFIELD organisationtype} = "school" "then insert this text" 'else
insert this text."}

When I run the merge I get the the field code but not the text I want.
What
am I doing incorrectly?




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
How do I do a conditional mail merge into a table tomtraff Mailmerge 5 March 29th 05 05:29 PM
IF statements always returning the "False" condition JCSadie Mailmerge 4 February 28th 05 03:42 PM
Conditional inclusion of WordArt? Bill Watkins Mailmerge 13 February 1st 05 03:51 PM
Conditional Cross Ref. Fr. Robert Microsoft Word Help 3 January 5th 05 08:47 PM
Conditional Text Hami Page Layout 1 December 13th 04 06:17 PM


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