RTF documents as templates

SparkOut SparkOutYNY at gmail.com
Mon Feb 21 07:45:28 EST 2011


If you use MS Word to produce a template file that contains your
[[Placeholders]] then there is a distinct problem with formatting. I believe
Jan's very own advice in one of the "Merge" newsletter articles was always
to "Save As" to as to force MS Word to write a completely new document out.
I'm not sure if that is always successful. MS Wordpad which comes as
standard on every Windows PC produces much cleaner rtf files.

I know from experience that MS WOrd can can mangle the formatting internally
so you get [[garbage{mangled rtf rubbish
formatting}place{stuffinserted}holders]] that are unusable for a merge.

However, I have also just revisted the merge function for a project I have
on the go, and now I too find that where a Placeholder variable for merging
is empty, the [[Placeholder]] in the rtf document is not empty - the square
brackets are stripped, but the Placeholder name is left.

So if my variables are: tName (containing "Mr Smith") and tAddress1
(containing "25 Some Street") and tAddress2 (which is empty) and tCity
(containing "London") 

and if the rtf document contains:

[[tName]], [[tAddress1]] [[tAddress2]] [[tCity]] then the output is:
Mr Smith, 25 Some Street tAddress2 London

How can I suppress the empty output in the placeholder fields?
(Ideally I would like to consider a mail-merge type blank line suppression
too, but I would really settle just for being able to merge to empty
placeholder tags.)

-- 
View this message in context: http://runtime-revolution.278305.n4.nabble.com/RTF-documents-as-templates-tp322967p3317262.html
Sent from the Revolution - User mailing list archive at Nabble.com.




More information about the use-livecode mailing list