How to create Microsoft Word document in ColdFusion

cfcontent application/msword - create Microsoft Word document

cfcontentMSWord.cfm


<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>cfcontent application/msword - how to create Microsoft Word document  in coldfusion</title>
</head>

<body>
<h2 style="color:DarkSeaGreen; font-style:italic">cfcontent tag example: how to create Microsoft Word document</h2>
<hr width="625" align="left" color="DarkSeaGreen" />
<br />

<a href="cfcontentMSWord1.cfm">Click Here To Get Authors List In A MSWord File</a>

</body>
</html>







cfcontentMSWord1.cfm


<cfquery name="authors" datasource="cfbookclub">
 select FirstName, LastName from authors
</cfquery>

<cfcontent type="application/msword" reset="yes">
Authors Name
=============
<cfoutput query="authors">
 #LastName# #FirstName#
</cfoutput>