Ideally they want to be able to generate the document on the iSeries and
place it in the IFS where Word can find it.  I also thought about generating
an RTF file and including replacement codes such as %%ORDERNO%% which the
programs could overwrite with the correct values, but on looking at an RTF
file's structure it looked too prone to errors. 

We have an application (not iSeries, but it doesn't matter) that uses RTFs as 
the templates for mail merges all the time. It's not as bad as it looks. The 
RTF file is just a big text file, so it's simple enough to open it in any 
language and basically to scan/replace of the template "marker" with the actual 
replacement value.

In our case we have our customers designate their markers w/double dollar signs 
since I've never seen that in normal text, so it's unlikely we'll replace 
something we shouldn't. For example, a template might be:

$$Name$$
$$Address$$

RE: $$Order$$

Dear $$Name$$,

Thanks for ordering $$item$$ on $$order date$$, we've charged you $$amount$$.

Sincerely,
-The company.

We don't have to deal with repeating groups like a list of line items, if you 
need that you'd need a better understanding of the RTF format.

One thing to be wary of, Word outputs text as it was entered, not as it's 
displayed. So, if you type in $$field$$ then you'll see a bunch of rtf and then 
$$field$$ and then more rtf. And scan/replace will find it. HOWEVER, if you 
type $$filed$$ and then reverse just the l&e to fix the problem then you'll get 
<RTF>$$fi<more rtf>el<more rtf>d$$<rtf> and you'll never find that no a 
scan/replace. So, the moral of the story, type the fields in one shot.

-Walden




As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.