Note that there are some explanatory texts on larger screens.

plurals
  1. POServer generated word file: Change default "save as" option to ".doc" instead of "website"
    primarykey
    data
    text
    <p>We're having an application where we generate a .doc file on our ColdFusion server. The file opens properly in MSWord and is displayed correctly. </p> <p>In Internet Explorer, it asks me wether to <em>download</em> or <em>save</em> the file. When saving, the file saves as file.doc in my download folder, which is correct.</p> <p>When opening directly from Internet Explorer, the file is displayed correctly. But when I do "save as" in MSWord, the default file type is "website" and not "word document".</p> <hr> <p>Here's the word's content. I know there are better solutions, but that's how we had it done then.</p> <pre><code>&lt;html xmlns:o='urn:schemas-microsoft-com:office:office' xmlns:w='urn:schemas-microsoft-com:office:word' xmlns='http://www.w3.org/TR/REC-html40'&gt; &lt;head&gt; &lt;title&gt;file name goes here&lt;/title&gt; &lt;!--[if gte mso 9]&gt; &lt;xml&gt; &lt;w:WordDocument&gt; &lt;w:View&gt;Print&lt;/w:View&gt; &lt;w:Zoom&gt;90&lt;/w:Zoom&gt; &lt;w:DoNotOptimizeForBrowser/&gt; &lt;/w:WordDocument&gt; &lt;/xml&gt; &lt;![endif]--&gt; &lt;style&gt;/*style goes here*/&lt;/style&gt; &lt;/head&gt; &lt;body&gt;body goes here&lt;/body&gt; &lt;/html&gt; </code></pre> <hr> <p>I had tried to add a doctype, but nothing happened.</p> <p>On ColdFusion, following happens:</p> <pre><code>&lt;cfcontent reset="true" type="application/vnd.ms-word" /&gt; #wordContent# &lt;cfheader name="Content-Disposition" value="attachment; filename=file.doc" /&gt; </code></pre> <hr> <p>I had also tried "application/msword" as MIME-Type, but nothing happened.</p> <p>I had tried to make it a .docx, but then it's malformed which seems logical, since it's not xml but html.</p> <p>I hoped, there might be some meta information, which grants me access to the default file name as in e.g. </p> <pre><code>&lt;o:Author&gt;Author name goes here&lt;/o:Author&gt; &lt;o:LastAuthor&gt;Last authors name goes here&lt;/o:LastAuthor&gt; &lt;o:Revision&gt;1&lt;/o:Revision&gt; &lt;o:Created&gt;#dateFormat(now(),"yyyy-mm-dd")#T#timeFormat(now(),"HH:mm")#Z&lt;/o:Created&gt; &lt;o:LastSaved&gt;#dateFormat(now(),"yyyy-mm-dd")#T#timeFormat(now(),"HH:mm")#Z&lt;/o:LastSaved&gt; &lt;o:Version&gt;12.00&lt;/o:Version&gt; &lt;/o:DocumentProperties&gt; </code></pre> <p>I also played with the informations given here <a href="http://en.wikipedia.org/wiki/Microsoft_Office_XML_formats" rel="nofollow noreferrer">http://en.wikipedia.org/wiki/Microsoft_Office_XML_formats</a></p> <p>But none of them seemed to work. So here I am, asking for help.</p> <p>Edit: Added screenshot of MSWord behaving wrong (german)</p> <p><img src="https://i.stack.imgur.com/kCo2E.png" alt="saving as gives me the wrong default file type"></p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    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.
 

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