• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1954
  • Last Modified:

Opening a Word Document using CFCONTENT

I have created a page (print_me.cfm) with the following line of codes:

<cfheader name="Content-Disposition" value="inline; filename=timeframe.doc" >
<cfcontent type="application/word"> \

<queries>
<table>
  Tables content
</table>

Basically this page will display the query output on a word doc format.  That is not a problem.  The issue I have is when the Word Document opens, it defaults to Web Layout.  Is there a code that I can add on my print_me.cfm page so when the Word Document opens, it opens on a Print Layout?
0
jramos74
Asked:
jramos74
  • 2
1 Solution
 
SidFishesCommented:
The issue is with word and not cfcontent.

if you do this

<cfheader name="Content-Disposition" value="inline; filename=timeframe.doc" >
<cfcontent type="application/word">
SomeData

it will open in Print Layout

as soon as you add a table, it opens in web view

afaik there is no work around
0
 
SidFishesCommented:
interestingly...

it only seems to be a problem with tables

other html tags

<cfheader name="Content-Disposition" value="filename=timeframe.doc" >
<cfcontent type="application/word">
<div>
<h3>SomeData</h3><br>
MOre Data
</div>

 will open in print view


0

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now