Query Results to a DoC File

My query is i have results of ysers table and i want them to export to the word Document DOC file. I searched google a bunch and here at experts echange too but did not found a solid solution which should works for me.

i tried one solution listed here:
<cfheader name="content-disposition" value="inline;filename=AccessToDoc.doc">
      <cfcontent type="application/msword">
      <table border="1">
     <tr>
          <th>First Name</th>
          <th>Last Name</th>
          <th>Email Address</th>
     </tr>
       <cfoutput query="endUsers">
     <tr>
          <td>#endUsers.firstname#</td>
          <td>#endUsers.lastname#</td>
          <td>#endUsers.emailaddress#</td>
     </tr>
       </cfoutput>
      </table>

But useless, it displayed my whole lot page inside it
LVL 16
Gurpreet Singh RandhawaWeb DeveloperAsked:
Who is Participating?
 
SidFishesConnect With a Mentor Commented:
try it this way


<cfsavecontent variable="docfile">
    <table border="1">
     <tr>
          <th>First Name</th>
          <th>Last Name</th>
          <th>Email Address</th>
     </tr>
       <cfoutput query="endUsers">
     <tr>
          <td>#endUsers.firstname#</td>
          <td>#endUsers.lastname#</td>
          <td>#endUsers.emailaddress#</td>
     </tr>
       </cfoutput>
      </table>
</cfsavecontent>

<cfheader name="content-disposition" value="inline;filename=AccessToDoc.doc">
      <cfcontent type="application/msword" >
<cfoutput>#docfile#</cfoutput>
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.