Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Eric_G
 
Posts: n/a
Default Can one different files in an "If then... else" WORD merge?

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?

  #2   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?

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?



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

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?




  #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?






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

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?









  #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?









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

Peter,
Many thanks. After much work, the merge does work. I found that I needed
to set the margins of the master document as the same as the underlying
"include text" WORD documents and remove the switches.

Thanks for your assistance.

"Peter Jamieson" wrote:

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?










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
Word should catalog misspelled words to study. rndthought Microsoft Word Help 39 May 21st 23 02:47 AM
Word 97 in Windows XP to maintain formatting Charlie''s Word VBA questions Microsoft Word Help 22 May 20th 23 08:51 PM
Reveal codes in a word document FUN101 Microsoft Word Help 4 May 16th 23 08:47 PM
Converting Word Perfect forms to Word forms elyse Microsoft Word Help 1 February 15th 06 08:17 PM
In Word, how can I see all files (*.*) in "save as"? citizen53 New Users 8 April 4th 05 04:56 PM


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