View Single Post
  #4   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Jamieson Peter Jamieson is offline
external usenet poster
 
Posts: 4,582
Default Embedding values of merge fields in the final document

INCLUDETEXT fields just include the file referenced in the field, e.g.

{ INCLUDETEXT "c:\\my inclusions\\my file.doc" }

You can include any file for which Word has a built-in or external
converter, e.g. Word .doc files, .rtf files, .htm files. If the converter
recognises "bookmark names" (named bookmarks in Word documents, ranges in
Excel) you can specify part of the document, e.g. if a Word document
contains a bookmark "mybm" you can use

{ INCLUDETEXT "c:\\my inclusions\\my file.doc" mybm }

to include just that part of the document. This can be useful to avoid
getting stuff you don't want, e.g. paragraph marks (which logically contain
paragraph format info., section marks, and the end-of-document mark which
all contain section/heder/footer markup). However, when you include text via
an external converter, Word always stuffs in at least one extra paragraph
mark (just to make the feature less helpful :-) )

Fields included within the INCLUDETEXT will be resolved during the merge.
I'm not convinced that that's the way you should go to achieve what you
need.

Peter jamieson

"Mike" wrote in message
...
Thank you for your answer. How can I setup mailmerge to populate
INCLUDETEXT
field? I think I need a bit of handholding on this one please.

Infinite thanks,

--Michael

"Peter Jamieson" wrote:

Roughly speaking, Word tries to "resolve" most field types so that the
fields have gone altogether in the output document. So for example SET
and
REF, and MERGEFIELD fields will probably all go. However, you may find
that
some fields such as { = } fields, { INCLUDEPICTURE } fields and {
INCLUDETEXT } fields remain, and some may remain if they are in
headers/footers, e.g. { PAGE } fields.

So your options are essentially:
a. find a way to achieve the output you need just using fields
b. mark the fields in some way so that you can easily find the resulting
text in the output and modify it. For exmaple, you might be able to
surround
each field with special characters such as ¬¬ or some such, or mark each
field in a particular way (colour it green, or apply a specific character
style).
c. in Word 2002/2003, use the Merge Events and VBA to do stuff to the
mail
merge main document before/after each record is merged
d. "roll your own" mailmerge.

Peter Jamieson

"Mike" wrote in message
...
Hi! I need to parse the final document and make some changes based on
the
values of merged fields. However, Word 2003 reports the count of fields
or
mail merge fields = 0.
I think it does it on purpose.

Is there a way I can embed the values of merged fields into the output
document? Is there a way I can write them into some kind of a bookmark?
What
are my options?

Many thanks in advance,

--Michael