T
Tony
I have a MS Word document with mail merge fields in it.
I've saved it as rich text format (RTF), and now I want to write a
perl program that will take this template file as input, replace the
mail merge fields with data, and then spit out a populated RTF file
for each record.
Is there a module to make this easier? I can see the mail merge fields
in the raw RTF document, but they're complex structures, and I don't
really want to learn the RTF spec in order to know what I should be
replacing in each case.
For example, if I replace the word "address" with a merge field called
"address", this is the extra code that appears in the RTF file:
}{\field{\*\fldinst { MERGEFIELD address \\* MERGEFORMAT }}{\fldrslt
{\lang1024 \'abaddress\'bb}}}{
And it's even more obscure when you have tables, and formatting etc.
I'll take a look at rtf::tokenizer, but my initial assesment is that
it's not quite what I'm after.
Any ideas?
Thanks, Tony
I've saved it as rich text format (RTF), and now I want to write a
perl program that will take this template file as input, replace the
mail merge fields with data, and then spit out a populated RTF file
for each record.
Is there a module to make this easier? I can see the mail merge fields
in the raw RTF document, but they're complex structures, and I don't
really want to learn the RTF spec in order to know what I should be
replacing in each case.
For example, if I replace the word "address" with a merge field called
"address", this is the extra code that appears in the RTF file:
}{\field{\*\fldinst { MERGEFIELD address \\* MERGEFORMAT }}{\fldrslt
{\lang1024 \'abaddress\'bb}}}{
And it's even more obscure when you have tables, and formatting etc.
I'll take a look at rtf::tokenizer, but my initial assesment is that
it's not quite what I'm after.
Any ideas?
Thanks, Tony