Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Ian Rowe
 
Posts: n/a
Default 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   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Cindy M -WordMVP-
 
Posts: n/a
Default 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   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Jamieson
 
Posts: n/a
Default 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

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
NO CODE - mail merge to Outlook with attachment with CC BrianH Mailmerge 1 February 10th 10 02:53 PM
Mail Merge - Parameter prompts twice... TL Mailmerge 6 June 17th 05 02:58 PM
mail merge with attachments AS Mailmerge 5 April 9th 05 09:49 AM
Word Compare and Merge Document Function EricM Microsoft Word Help 2 March 28th 05 11:53 PM
Lost mail merge function button Robert Judge Mailmerge 1 January 11th 05 05:22 AM


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