0 Replies Latest reply on Apr 1, 2013 12:25 PM by jerryshay

    how to combine two Word documents?

    jerryshay

      I need to combine a Cover Letter (in Word) with an existing Word document (already uploaded). I tried the following code, but it didn't work. Please help. I am using CF 8.

       

      Thanks

      Jerry

      =====

       

      <cfset pathToRTF = GetDirectoryFromPath(GetCurrentTemplatePath()) & "coverLetter.rtf" />
      <cfset rtfFile = GetDirectoryFromPath(GetCurrentTemplatePath()) & "mainDoc.rtf" />

      <cfset coverLetter = FileRead(pathToRTF) />
      <cfset mainDoc = FileRead(rtfFile) />

      <cfset finalRTF = "">

      <cfscript>
          finalRTF = coverLetter & "\page" & mainDoc & "\page"; 

      </cfscript>

      <cfset FileWrite(rtfFile, finalRTF) />