如体,特别要说明的是,不是要那种上传,下载,勾选不在下载提示,然后再直接用OFFICE打开的那种,要的是在网页中直接打开相当于用js调用ActiveObject控件的那种方式,类似下面的方式
首先,用Script创建一个本地的对象:openDocObj = new ActiveXObject("SharePoint.OpenDocuments.2"); // 为了兼容Office XP,可以创建“SharePoint.OpenDocuments.1”然后,调用openDocObj的相应的方法。比如打开服务器上的一个Office文档:openDocObj.ViewDocument("http://www.abc.com/documents/sample.doc");上述方式没测试成功。不知道是什么原因

解决方案 »

  1.   

    System.Diagnostics.Process.Start("IExplore.exe", "C:\myPath\myFile.doc")
    这种可以不?WEBOFFICE 第三方。。WORD转换HTML 输出/// <summary>
      /// word转成html
      /// </summary>
      /// <param name="wordFileName"></param>
      private string WordToHtml(object wordFileName)
      {
      //在此处放置用户代码以初始化页面
      Word.ApplicationClass word = new Word.ApplicationClass();
      Type wordType = word.GetType();
      Documents docs = word.Documents;  //打开文件
      Type docsType = docs.GetType();
      Document doc = (Document)docsType.InvokeMember("Open",
      System.Reflection.BindingFlags.InvokeMethod, null, docs, new Object[] { wordFileName, true, true });  //转换格式,另存为
      Type docType = doc.GetType();  string wordSaveFileName = wordFileName.ToString();
      string strSaveFileName = wordSaveFileName.Substring(0, wordSaveFileName.Length - 3) "html";
      object saveFileName = (object)strSaveFileName;
        
      docType.InvokeMember("SaveAs", System.Reflection.BindingFlags.InvokeMethod,
      null, doc, new object[] { saveFileName, WdSaveFormat.wdFormatFilteredHTML });  docType.InvokeMember("Close", System.Reflection.BindingFlags.InvokeMethod,
      null, doc, null);  //退出 Word
      wordType.InvokeMember("Quit", System.Reflection.BindingFlags.InvokeMethod,
      null, word, null);  return saveFileName.ToString();
      }直接读取 word输出