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

Tip: Looking for answers? Try searching our database.

conditional if statements

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Smokey smith - 14 Apr 2005 12:29 GMT
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?
Charles Kenyon - 14 Apr 2005 13:57 GMT
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.
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://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.

>I am producing a marketing letter that will go to a range of organisations.
>I
[quoted text clipped - 7 lines]
> What
> am I doing incorrectly?
Peter Jamieson - 14 Apr 2005 15:36 GMT
> 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

> Try:
> {IF  "{MERGEFIELD organisationtype}" = "school" "true text" "false text."}
[quoted text clipped - 14 lines]
>> What
>> am I doing incorrectly?
Peter Jamieson - 14 Apr 2005 15:34 GMT
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
>I am producing a marketing letter that will go to a range of organisations.
>I
[quoted text clipped - 7 lines]
> What
> am I doing incorrectly?
Smokey smith - 14 Apr 2005 23:38 GMT
Oops no.... that solved the problem  Thank you for your prompt reply

> Are the {} all the special field braces you can get by pressing ctrl-F9?
>
[quoted text clipped - 13 lines]
> > What
> > am I doing incorrectly?
 
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.