Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Mike Mike is offline
external usenet poster
 
Posts: 229
Default Embedding values of merge fields in the final document

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

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

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



  #3   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Mike Mike is offline
external usenet poster
 
Posts: 229
Default Embedding values of merge fields in the final document

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




  #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






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
Merge document with form fields Dottie Microsoft Word Help 1 May 26th 06 04:20 AM
Document with mail merge fields - turn on spell check for entire d Vivian P Microsoft Word Help 5 April 1st 06 03:54 AM
How to get all mail merge fields in a document [email protected] Mailmerge 3 February 17th 06 05:43 AM
merge instructions from text file Steve Mailmerge 8 November 26th 05 03:31 AM
page number printing on a merged report Print Page # On Merged Report Mailmerge 6 October 17th 05 05:18 AM


All times are GMT +1. The time now is 09:53 PM.

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"