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 / May 2006

Tip: Looking for answers? Try searching our database.

Mail merge - Ask / If function

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Ian Rowe - 05 May 2006 13:07 GMT
I have a mail merge document where I have created an 'Ask' function. When the
document is run, the ‘Ask’ function displays a question. I have used the 'If'
function so when the answer is inputted it will merge the relevant wording. I
can do this where there are two options/answers, but I need it to work for
four options. Is there an ‘If/Or’ function?

MS Office 2003
Cindy M  -WordMVP- - 05 May 2006 14:47 GMT
Hi =?Utf-8?B?SWFuIFJvd2U=?=,

> I have a mail merge document where I have created an 'Ask' function. When the
> document is run, the ‘Ask’ function displays a question. I have used the 'If'
> function so when the answer is inputted it will merge the relevant wording. I
> can do this where there are two options/answers, but I need it to work for
> four options. Is there an If/Or function?

No. What you have to do is either set up four separate IF fields (where the second
option is to display an empty string - "") or nest multiple IF fields. The first is
certainly simpler. The second would look something like this:
   { IF x = y "true" "{ IF x = z "true" { If x = a "true" "false" }" }" }

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or reply in
the newsgroup and not by e-mail :-)
Peter Jamieson - 05 May 2006 14:52 GMT
There are several ways to achieve this, none of them as obvious as you might
hope. Suppose your Ask field results in a bookmark called Option and you can
enter A,B,C or D as the option. Suppose if you have option A or C then you
want "text1", and if you have option B or D you want "text2"

Then you can spell out the possibilities

{ IF "{ Option }" = "A" "text1" ""
}{ IF "{ Option }" = "B" "text2" ""
}{ IF "{ Option }" = "C" "text1" ""
}{ IF "{ Option }" = "D" "text2" "" }

or you can nest them

{ IF "{ Option }" = "A" "text1"
"{ IF "{ Option }" = "B" "text2"
"{ IF "{ Option }" = "C" "text1"
"{ IF "{ Option }" = "D" "text2" "" }" }" }" }

To get something more like a traditional "or", you can use COMPARE fields
inside an { = } field, e.g.

{ COMPARE "{ Option }" = "A" }
returns 1 if Option is "A", 0 otherwise

{ =or({ COMPARE "{ Option }" = "A" },{ COMPARE "{ Option }" = "C" }) }
returns 1 if option is "A" or "C", 0 otherwise

so you can use
{ IF { =or({ COMPARE "{ Option }" = "A" },{ COMPARE "{ Option }" = "C" }) }
= 1
"text1" "text2" }

There are other ways you can use expressions in an { = } field to do this
kind of thing, and you ma also be able to arrange that the values of Option
you enter make it easier to do that.

Alternatively, you can use the option name to construct a file or bookmark
name for use in an INCLUDETEXT field, e.g.

{ INCLUDETEXT "c:\\mydata\\include{ Option }.doc" }

where includeA.doc and includeC.doc contain "text1" and so on

or put the text "text1" in a document called include.doc, bookmark it with
"bmA" and "bmC",
put the text "text2" in include.doc, bookmark it with "bmB" and "bmD"

and use

{ INCLUDETEXT "c:\\mydate\\include.doc" "bm{ Option }" }

In all these cases you must deal witht he case where Option is not A,B,C,D.

All the {} have to be the special field code braces you can enter using
ctrl-F9

Peter Jamieson

>I have a mail merge document where I have created an 'Ask' function. When
>the
[quoted text clipped - 6 lines]
>
> MS Office 2003

Rate this thread:






 
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.