Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.
-
Mattsala #1
Create RTF / Word Docs - Line Feed / Carriage Return
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
Mattsala Guest
-
MTB-How to convert multiple .pdf docs to MS Word docs all at same time.
Is there a way to convert multiple .pdf documents to MS Word Docs all at the same time without having to open each .pdf document & save as a MS Word... -
create line with arrows at the tip (microsoft word style)
Hi all: Does anyone know how to create a line that has an arrow at the tip. This is similar to microsofts line object in drawing. I am able... -
HTML mail tactics? Is there a way of designating a new line in ASP without a carriage return?
> The HTML mails I'm trying to send have ASP code in them. hmmm.... the ASP code won't run, you know. If you mean what I think you mean, that... -
Carriage Return / Line Feed question
<de-lurk> Hello all, Given the script listed below: LINE: while (<>) { while (! m/.+?<endad>/){ if(m/<cat:(\d+)>/) { $cat = $1; -
Line Feed vs Carriage Return
"Lynn" <noemail@yahoo.com> wrote in message news:011901c34717$b9a7d5f0$a601280a@phx.gbl... char(10) is the line delimiter on Unix. char(13) +...



Reply With Quote

