View Single Post
  #6   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?

You certainly can nest one field inside another - one thing you can check is
to turn on the merge preview, then use Alt-F9 to display the full code of
the INCLUDETEXT field, then select the nested MERGEFIELD field, right click,
and select Toggle Field codes. You should then be able to see the full path
name of the file that the INCLUDETEXT is trying to include. I would check
that all the backslashes are doubled up (i.e. use c:\\xyz\\abc.doc insted of
c:\xyz\abc.doc) and that there aren't any extra spaces in the path name
(they are rather easy to insert accidentally).

You may also need to uncheck Word Tools|Options|General|Web
options|Files|Update links on save.

The problem with the INCLUDETEXT command is that the main document I am
using also has a few graphic images in it and so INCLUDE TEXT doesn't
appear
to pick up the images?


It should do, but can you confirm that it is the included document that
contains the images, not the "mail merge main document", i.e. the one that
is attached to the data source and contains the images. Assuming that it is
the included document that contains the images, try the simple case where
you open a new blank document and use Insert|File to insert the whole
docuument, clicking the dropdown on the Insert button and selecting Insert
as link.That should insert an Includetext field, and you should be able to
select it, press F9 to update it, and still see the images. I've just done
it here. But if you don't see the images, there could be a memory problem or
some such.

Peter Jamieson

"Eric_G" wrote in message
...
When one tries the latter method, the "filename not found" response
appears
-- which makes sense as I don't believe one can have a mergefield within a
mergefield.

The problem with the INCLUDETEXT command is that the main document I am
using also has a few graphic images in it and so INCLUDE TEXT doesn't
appear
to pick up the images?

I would have thought there was some way to pick up an entire file within
the
IF merge?


"Peter Jamieson" wrote:

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?