Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
Mail merge - Ask / If function
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 |
#2
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
Mail merge - Ask / If function
Hi ?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 :-) |
#3
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
Mail merge - Ask / If function
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 "Ian Rowe" Ian wrote in message ... 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 |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
NO CODE - mail merge to Outlook with attachment with CC | Mailmerge | |||
Mail Merge - Parameter prompts twice... | Mailmerge | |||
mail merge with attachments | Mailmerge | |||
Word Compare and Merge Document Function | Microsoft Word Help | |||
Lost mail merge function button | Mailmerge |