Excel和IE7 - 防止IE打开Excel文件 [英] Excel and IE7 - Prevent IE from opening Excel files
问题描述
我有一个内部网页,用于超链接到文件服务器上的各种文件。
本地文件链接的问题是Microsoft Excel文件在IE7而不是Excel中打开。 br>
这导致Excel文件VBA代码和其他功能正常工作。
I have a intranet webpage that is used to hyperlink to 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.
有没有办法使用HTML / Javascript强制文件在Excel中打开,而不是IE7?
Is there a way using HTML/Javascript to force the file to be opened in Excel instead of IE7?
推荐答案
它已经很久了,但我曾经做过这样的事情。这显然是服务器端代码,我知道你指定了javascript / html。
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");
编辑
这是一个体面的例子,虽然有点旧 http://aspalliance.com/259_Downloading_Files__Forcing_the_File_Download_Dialog
Here is a decent enough example though a little old http://aspalliance.com/259_Downloading_Files__Forcing_the_File_Download_Dialog
这篇关于Excel和IE7 - 防止IE打开Excel文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!