View Single Post
  #4   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Jamieson
 
Posts: n/a
Default Can one different files in an "If then... else" WORD merge?

I missed some characters on this one (although I don't think it will work
anyway...

{ IF "{ MERGEFIELD Language }" = "E" "{ INCLUDETEXT
"c:\\mydocs\\myfilleE.doc" }" ""
}{ IF "{ MERGEFIELD Language }" = "F" "{ INCLUDETEXT
"c:\\mydocs\\myfilleF.doc" }" "" }

But what happens when you try

{ INCLUDETEXT "c:\\mydocs\\myfile{ MERGEFIELD Language }.doc" }

? In all cases, all the {} eed to be the special field code braces you can
insert using ctrl-F9.

HYPERLINK only generates a hypertext link - it doesn't actually include
anything

Peter Jamieson
"Eric_G" wrote in message
...
Unfortunately, the "includetext" command didn't work. While the main
document isn't too large, I have separate the text into two separate
files.
I even tried the same logic but using the 'HYPERLINK' command as opposed
to
INCLUDETEXT but it also didn't work.....

"Peter Jamieson" wrote:

In theory you ought to be able to do

{ IF "{ MERGEFIELD Language }" = "E" "{ INCLUDETEXT
"c:\\mydocs\\myfilleE.doc" ""
}{ IF "{ MERGEFIELD Language }" = "F" "{ INCLUDETEXT
"c:\\mydocs\\myfilleF.doc" ""
}

but in practice you may have to use something more like

{ INCLUDETEXT "c:\\mydocs\\myfile{ MERGEFIELD Language }.doc" }

and deal with the situation where Language is not "E" or "F", e.g. have
another file called myfile.doc and use

{ INCLUDETEXT "c:\\mydocs\\myfile{ IF "{ MERGEFIELD Language \*Upper }" =
"E" "E" "{ IF "{ MERGEFIELD Language \*Upper }" = "F" "F" "" } } }

etc.

Peter Jamieson
"Eric_G" wrote in message
...
I am attempting to perform a merge where one field indicates "Language".
Where the language field is "E", I want to use one WORD .doc file and
where
the language is "F", I want to invoke a different WORD .doc file. Can
I
do
this within a WORD merge using the 'IF... THEN ELSE" merge codes or if
not,
is there a better way?