Hi

I curently have data that I output to a word file.

My requirement is to loop through a query and output each result in the
wordfile. How would one go about doing that? My current code is included
below, and all I have in the RTF word file is placeholders between % signs
that coldfusion replaces.

<cfset templatepath="c:\inetpub\wwwroot\solveit\printdocs\" &
"a1lettofdemand.rtf">

<cffile action="read"
file="#templatepath#"
variable="RTF">

<cfset RTF = Replace(RTF, "%worktelephone%", getdebtor.worktelephone)>
<cfset RTF = Replace(RTF, "%firstname%", getdebtor.firstname)>
<cfset RTF = Replace(RTF, "%lastname%", getdebtor.lastname)>

<cfset newfile="#newfile#" & "#DateFormat(Now())# #getdebtor.firstname#
#getdebtor.lastname#.doc">

<cffile action="write" nameconflict="OVERWRITE" file="#newfile#"
output="#RTF#">

<cfheader name="Content-Disposition" Value="filename=finaldoc.doc">
<cfcontent type="application/msword">#RTF#

______________________________________________________________________
Why Share?
  Dedicated Win 2000 Server � PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER
  Instant Activation � $99/Month � Free Setup
  http://www.pennyhost.com/redirect.cfm?adcode=coldfusionc
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to