how ?? rtf document mail merge.

D

Deepak

hi all

please suggest some wayout to use rtf document for mail merge.

Actually i don't want to use msword applicaion object.
I am try to read one rtf document file by file stream and replacing the tags
e.g.<firstname>) with some value. That is fine with one record but how about
more records. So i don't know haw do I go about it.

If anybody let me know about it ... that will be great help

thanx
deepak
 
P

Peter Jamieson

If you know that the merge is "simple" and all you need to do is generate
one output document per record, then I guess what you do is

For each record in your data source
a. open the rtf file
b. open a new output file
c. locate each Mergefield and replace it with your data, outputting to the
output file
d. close both files

However, things that that may not cope with are
a. NEXT and similar fields
b. the fact that each field in the RTF file stores the field result at the
time the document was stored, so e.g. unless you also calculate the results
of IF, = and nested fields you probably won't see the correct results unless
you refresh all the fields when the document opens. And even then you may
not see what you expect
c. if the merge would cause any text to spill over boundaries such as page
boundaries you may find that the rtf you are creating does not work
correctly.
 
D

Deepak

hi Peter

you said "one output document per record".

Creating one output document per record is done.
But requirement need to merge all record to one output document.

Any idea how to merge all records to one output document ??

Deepak
 
P

Peter Jamieson

But requirement need to merge all record to one output document.

Well in that case you have a much harder task because the .rtf file
essentially consists of two parts:
a. header, containing style definitions etc. and
b. body

and you have to decide which parts of the header may need to be altered or
duplicated and altered. Which you probably know already, but...

....I think what I would do is
a. take the original document
b. merge it to a new document using one data source record and save as .rtf
c. merge it using two records and save as .rtf
d. compare the header sections of the two outputs and decide what to do.
 
D

Deepak

Thanx Peter

yes i will try this way.

Deepak


Peter Jamieson said:
Well in that case you have a much harder task because the .rtf file
essentially consists of two parts:
a. header, containing style definitions etc. and
b. body

and you have to decide which parts of the header may need to be altered or
duplicated and altered. Which you probably know already, but...

...I think what I would do is
a. take the original document
b. merge it to a new document using one data source record and save as ..rtf
c. merge it using two records and save as .rtf
d. compare the header sections of the two outputs and decide what to do.
 

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