3 Replies Latest reply on Jun 25, 2007 6:43 AM by mat1492

    Cold Fusion export to Word Document

    Raymond_McCague Level 1
      I have a Coldfusion Intranet application which builds an html file which then gets exported to the local drive and then named with a doc extension. Then the document is read in Microsoft Word. The problem is that I want to have headers and footers put on the page along with our logo and page numbers. I would like to have the Cold fusion code do to it for me while it is still in HTML format.

      Some possible solution which I did not think were good follow:

      Create a dot file with headers, footers, page numbers and log in word and then copy and paste the HTML file into the dot file and save as doc.

      Use letter head paper.

      Create a web service which reads the HTML page and dynamically places the header and footers on the page as it is being
      read before it is written. (I think the possible solution is too complicated).

      Coldfusion 7 support writing headers and footers to PDF files but I need it in a Word format.

      Thanks for your help
        • 1. Cold Fusion export to Word Document
          I am not sure about the options that you have given are feasible. I know coldfusion creates word files but not like the way PDF is built. However I do remember searching the old macromedia or allaire site for a custom tag that would build a word document with headers and footers and found one. But I do have an simple option, which you can give it a try.

          Create a word document template with what ever header, footer, images etc. and merge it with the data you want to present. It will produce a new word document what you are looking for. It's the Mail Merge (Word.MailMerge) feature of Microsoft word that can be used.
          • 2. Re: Cold Fusion export to Word Document
            Level 7
            make a mock-up of the file in MS Word. Save it as a Web Page (NOT Web
            Page, Filtered, if you a given that option). Open the saved file in an
            html editor and check all the (rediculous) code MS Word puts in there.
            If you had headers/footers, you will notice they are saved as a separate
            .htm file called header.htm in a folder called [your word doc
            name]_files. open that one in an html editor, too, and check the code.
            you will basically have to output your html formatted like that so that
            when you save the file with a .doc extension MS Word will pick us your
            content and headers/footers.
            Note: when file is opened, MS Word will ask if you want to convert it
            from HTML format, even if the file has a .doc extension.

            i have never actually tried this with Word, but it works with Excel...

            Azadi Saryev
            • 3. Re: Cold Fusion export to Word Document
              mat1492 Level 1
              Here is an article on IRT. It may be of help.