开发者

Excel and IE7 - Prevent IE from opening Excel files

I have a intranet webpage that is used to hyperlink t开发者_如何转开发o various files on a file server.

The problem with the local-file linking is that Microsoft Excel files are opened in IE7 instead of Excel.

This results in the Excel files VBA code and other features from working correctly.

Is there a way using HTML/Javascript to force the file to be opened in Excel instead of IE7?


its been a long time but I used to do something like this. This is server side code obviously, I know you specified javascript/html.

Response.ContentType = "application/vnd.ms-excel";
Response.AppendHeader("content-disposition", "attachment;filename=test.xls");

EDIT

Here is a decent enough example though a little old http://aspalliance.com/259_Downloading_Files__Forcing_the_File_Download_Dialog


Or in PHP you would do this:

 //send headers that should force download
 header('Content-Type: application/vnd.ms-excel');
 header('Content-Disposition: attachment; filename="downloaded.pdf"');
 // and output the file:
 readfile('file.xls');


Well, if you are feeling a bit naughty: http://support.microsoft.com/kb/162059

"""To configure Internet Explorer to open Office files in the appropriate Office program instead of in Internet Explorer, use one of the following methods. """

It won't really help for systems out of your control ... unless, of course you can convince them to run some privileged ActiveX/script, .reg file, or modify the settings as described (I do not really recommend any of these).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜