Home |
Search |
Today's Posts |
#1
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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 | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How do I do a conditional mail merge into a table | Mailmerge | |||
IF statements always returning the "False" condition | Mailmerge | |||
Conditional inclusion of WordArt? | Mailmerge | |||
Conditional Cross Ref. | Microsoft Word Help | |||
Conditional Text | Page Layout |