Back in the old days before CF could easily create documents I had to do this sort of thing. What ended up working best was a sort of poor-man's mail-merge approach. Generate the RTF templates with formatting, layouts, headers, etc. At the spots where content needs to be inserted, just type in something like "placeholder1", "placeholder2", etc. Then in your CF script that generates the actual document use CFFILE to read in the template to a CF var, and do a replace() to replace each of the "placehoder" instances with the appropriate dynamic data. Note that you will not be able to format that data being inserted (since the formatting is done in rtf), so if you are trying to populate lists, tables, etc., then it's going to take a lot more work. That would mean experimenting with using Word (or whatever) to create sample rtf strings for lists, tables, etc., to see what they need to look like, and then in your CF code that replace()s the "placeholders" you would include not just the dynamic values, but also the associated rtf syntax elements to get the look and feel you want. The same holds true for handling things like line breaks and paragraph breaks.
There used to be a CF function running around for creating sheets of labels for printers. What it did was to create an RTF document that you would then open in Word to do the actual printing. If you can find it laying around it might provide some insight into creating entire RTF documents from within CF.
Thank you for the reply. What you mentioned is how I have envisioned generating the RTF initially, the only difference would be the placeholders will most likely be wrapped in brackets ie. [placeholderX]. So we are on the same thought track up to this point.
After the document is created though I was hoping to create a way for the user to view the RTF that was generated, allow them to edit it, and then save the changes. This is the most important piece as far as this project goes.
Thanks again for your suggestions.
Getting the document back to the user is the easy part - just create the RTF document in your CF script and save it to the server, then use the CFCONTENT and CFHEADER tags to get it back to the user. Not sure what the mime type is for rtf but that's what Google is for. There are plenty of posting on this forum that explain how to use these tags to get Word, Excel, etc., back to the user. There is some dependency on the browser as to whether it is opened automatically by the browser in Word, or whether the user will get the "Run or Save" dialog box.