Progress to Word

Hi,

Looking for some direction please.

I have been given a template of a standard letter. On the letter are a number of fields which I will need to populate from our customer table (i..e name, address, ref no etc). The generated document will then print (will be a number of customers in each print run).

Just looking for suggestions on how I can achieve this. I have interfaced with Excel from Progress previously but have done nothing with Word.

All help appreciated.
Paul
 

mrobles

Member
This example assumes that the data are delimited with '**'
FOR EACH customer.
run sr('**nombre**',customer.name).
run sr('**direccion**',customer.address).
END.

Procedure sr.
DEFINE INPUT PARAMETER busca AS CHAR.
DEFINE INPUT PARAMETER cambia AS CHAR.
word:Selection:Find:ClearFormatting.
word:Selection:Find:Text = busca.
word:Selection:Find:Replacement:Text = "".
word:Selection:Find:Forward = True.
word:Selection:Find:Format = False.
word:Selection:Find:Execute.
word:Selection:TypeText(cambia).
END.
 

Rob Fitzpatrick

ProgressTalk.com Sponsor
Rather than doing search and replace, it sounds like your situation is well suited to a Word mail merge. First create merge fields in your template. Then each time you want to do a print run, create a data source from your customer table and then run the merge.
 
Top