Hi All,

Not a question, a solution! I was having a hard time with this one, and
thought this might help someone out in the future.

1. Creating a RTF document on the fly from a form that was filled in (or a
database record).
2. Save RTF to file.
3. Email to user.

Client requested the RTF be formatted well, so I created a template in MS
WORD, save as RTF, then use the following syntax to populate it.

<cffile action="read"
file="#TemplatePath#"
variable="rtf">

<!--- replace placeholder text with form content --->
<cfset RTF = Replace(RTF, "%request_dt%", Form.request_dt)>
<cfset RTF = Replace(RTF, "%firstname%", Form.firstname)>
<cfset RTF = Replace(RTF, "%lastname%", Form.lastname)>

<!--- Step 3. Write file out to file system --->
<cfset NewTemplatePath = ThisFolder &
"THCU_Consultation_Planning_Form-001.rtf">
<cffile action="write"
file="#NewTemplatePath#"
output="#rtf#">

One of the form fields that populated the RTF file was a comma delimited list
that the client wanted split onto individual lines... so I tried...
<cfset newline = "#chr(13)##chr(10)#">
<cfset new_outcomes = REPLACE(rs_Plan.outcomes,",","newline ","all")>

which never worked!!! ARGH.

Found the RTF syntax for newline / new paragraph, inserted this instead, and
presto, all working...

<cfset new_outcomes = REPLACE(rs_Plan.outcomes,","," \par ","all")> <!---
carriage return, line-feed IN RTF Syntax--->

Hope this helps someone out sometime!

Cheers,

Matts