cfcontent not invoking MS Word
Hi all
I am using Coldfusion 7.
I have a .rtf file as a template, with various placeholders placed throughout. I use cffile to read this template. I then have a query that replaces the placeholders with data. I then attempt to invoke MS Word to save the file as a .doc file. The problem is I only get garbage code once I execute this. I believe I am looking at the actual text data of the .rtf file, and Word is never invoked.
<!--- Read template into variable "rtf" --->
<cffile action="read" file="#fileLocation##fileName#" variable="rtf">
<!--- Replace placeholders with data --->
<cfset rtf = replace(rtf, "%InvoiceNumber%", trim(invoice), "ALL")>
blah blah blah.......
<!--- Suggest default filename for document --->
<cfheader name="Content-Disposition" value="filename=INVOICE.doc">
<!--- Set the content type so Word is invoked --->
<cfcontent type="application/msword">
<cfoutput>#rtf#</cfoutput>
Any suggestions? Thanks in advance.
-J
