Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I had the need to create MS Word documents before and did much research into which is the best method to do it. In the end I found out that using MS Word as a COM object is a really, really bad idea, mostly notably due to the performance issues you mentioned, but also due to security issues it brings. It's just a bad idea and definitely will not scale up to multiple users.</p> <p>However, I did come up with two other acceptable solutions. This was quite a while ago and I don't have the code with me anymore, but I'll tell you what I can remember as best I can.</p> <ol> <li><p>I saved a word document as word xml document, opened it in a plain text editor, took it apart, and used ColdFusion to auto generate what I needed. This worked well and there were no performance issues, but taking apart the xml and figuring out how to make what I needed was tedious and took some time.</p></li> <li><p>I just did regular html, designing the report to look nice as a web page and then added the cfheader and cfcontent tags to tell the browser the content was a word document. This option worked, but I think I may have gotton warnings that the attachment is not formatted correctly as a word document, do you want to open it anyway? Opening it appeared fine in MS Word and users could save it to the desktop as a doc file.</p></li> </ol> <p>Hope this helps.</p> <p><strong>EDIT:</strong> Sorry, my code snippet didn't appear correctly, here it is...</p> <pre><code>&lt;cfheader name="content-disposition" value="attachment; filename=report.doc" /&gt; &lt;cfcontent type="application/msword" /&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload