Embed fields in a separate source file?

T

trf

I'm trying to create a "catalog" type mail merge document, but for 60 of the
~100 records, a sizable chunk of the text has already been written (and it
doesn't make sense to regenerate it using a new mail merge). I believe that I
need to use an IF field in conjunction with an INCLUDETEXT field:
{ IF {MERGEFIELD AlreadyWritten } = "Yes" "{ INCLUDETEXT c:\\xxx.doc }"
"<other text and fields>" }.

But, since there are 60 different versions of that text that's already been
written (a different version for each record), I can't just refer to one doc
in <xxx.doc>. What I'd like to do is set up all 60 of those already-written
chunks of text into one document, establish 60 bookmarks representing the
text that corresponds to each record, and then in the INCLUDETEXT field,
reference the range that corresponds to a specific record.

How do I do that? Is there a way outside VBA? If VBA is the only way, does
that mean that I might as well code the entire merge process (which will
involve a number of nested conditional statements anyway) into VBA rather
than using non-VBA mail merge fields?

Thanks!
Rob
 
G

Graham Mayor

You cannot practically cancel a message - as messages are peered across a
variety of news servers over which you have no access rights, so ensure you
post what you intend or it will be recorded forever. You can change the
title in replies if that appeals, though frankly it doesn't help much here
:)

Much the easiest way to achieve this is to set an extra field in your data
source to indicate which of your 60 texts is relevant to that record. Then
you can use the information to ensure you merge the right bit of text. The
method is essentially that shown at
http://www.gmayor.com/mail_merge_graphics.htm albeit it is text you are
merging. You could save each text as a separate file to match your number,
or you could name the bookmarks to match the number. You then need only
insert the includetext field where either

{ Includetext "c:\\path\\{Mergefield number}.doc"}
or
{Includetext "c:\\path\\filename.doc" {mergefield number}}

should work

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top