请问,如何在ASP。NET中直接打开doc文档?
我不想要通过链接打开那种,我希望是点击文件名后,直接打开doc文档,第一:不询问保存还是打开,第二,不出现word的编辑框,只能看文件中的内容。

解决方案 »

  1.   

    http://quitgame.cnblogs.com/archive/2005/03/08/114997.html
      

  2.   

    提醒,机器必须安装了office才行
      

  3.   

    <%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Default.aspx.cs" Inherits="_Default" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title></title>
    <script type="text/javascript">   
      function   Validator()     
      {     
            var openDocObj;     
            openDocObj   =   new   ActiveXObject("SharePoint.OpenDocuments.2");
            openDocObj.ViewDocument("F:\Visual Studio 2005\PMIS_hk\file\00001_LOA文件_1.doc");     
      }   
      </script> 
    </head>
    <body>       
        <form id="form1" runat="server">
        <div>
            <asp:Button ID="Button1" runat="server" Text="Button" OnClientClick="Validator()" />
        
        </div>
        </form>
    </body>
    </html>这样写后,为何点击按钮不打开文件呢??
      

  4.   

    通过hyperlink链接word,直接打开
      

  5.   

    那种方法会询问是打开还是保存,而且会显示Word的编辑窗,我不希望出现编辑窗~~~
      

  6.   

    直接转换成HTML打开,也可以用IFRIM打开
      

  7.   

    我依稀记得在页面里超链接直接指向DOC文件的时候。好像是直接打开,但是又好像是会根据设置的不同……