我在vs调试环境下一切正常,可是到了IIS里就提示这个,真是好生郁闷public void OpenWord_Click(object sender, EventArgs e)
    {        try
        {
            test = new CCWordApp();
            test.Open();            Assess assess = new Assess();
            SqlDataReader dr = assess.GetMorePoint();            test.SetFontName("仿宋_GB2312");
            test.SetAlignment("Left");
            test.InsertLineBreak(1);
            test.SetFontSize(10);             while (dr.Read())
            {
                test.InsertText("高管姓名:");
                test.InsertText(dr["ManagerName"].ToString());
                test.InsertText("\r");
             }
            dr.Close();
            test.SaveAs(ConfigurationManager.AppSettings["WordDoc"] + "temp.doc");            test.Quit();        }
        catch (Exception exc)
        {
            Response.Write(exc.Message);
            test.Quit();
        }

解决方案 »

  1.   

    test = new CCWordApp();
    if(test==null)
      throw new Exception("寻找异常要稍微准确一点!");test.Open();
      

  2.   

    sp1234(情色玩的不够,继续上奥运玩吧) 
    ---------------------------------------
    除了该死的、天杀的“未将对象引用设置到对象的实例”外,没有抛出其它异常zty0527(zty0527) 
    ------------------------------
    什么权限问题?
      

  3.   

    catch (Exception exc)
            {
                Response.Write(exc.Message);
    if(test!= null)
    {            
          test.Quit();
     }       }-----难免有错,错了莫怪.
      

  4.   

    错误信息是你write的信息吗?我还以为是异常呢,如果是异常,只可能出现在catch里面,因为前面的异常已经catch了去掉try catch 看哪一行出错-----难免有错,错了莫怪.