tags:

views:

15

answers:

2

I have a requirement to launch .dot files (ms word templates) as new documents from the browser...

Let me explain... if you click on a .dot file in Windows Explorer it opens a new document and runs any macros... you can right click and edit the template...

I want to link to the files, so I use <a href="file://myserver/templates/letter.dot">Letter</a>... However this then prompts for the "Download File" dialogue box... and then if I click "Open" it opens the template in edit mode... not the required new document mode...

This may be a technical impossibility but can I achieve the desired result in ActiveX or something??

+1  A: 

You need to set the right headers from the server (I don't think you can do this with local files)

Header:

//Word
header('Content-Type: application/vnd.ms-word');

//Excel
header('Content-Type: application/vnd.ms-excel');

//To "force" as a download attachment vs. opening in the browser
header('Content-Disposition: attachment; filename="template.dot"');
scunliffe
A: 

Instead of linking to the .dot files directly, link to .lnk (Windows link files)... this magically makes the template open in the correct way.

Simon

related questions