Asp.net中能不能调用Word,例如:打开一个模板文件对其进行,文字,图片,表格的插入等...

解决方案 »

  1.   

    可以的,引用word对象,还要用dcomcfg 调整 aspnet用户的权限用dcomcfg 调整 aspnet用户的权限
    具体看   http://support.microsoft.com/default.aspx?scid=kb;zh-cn;288366
      

  2.   

    你的word是要求在网页里面打开还是直接用word调用,如果是直接调用,我这里倒是有代码
    string sql="select st_nr from stid1 where st_id=1";
    SqlConnection connection = new SqlConnection("Server=.;uid=sa;pwd=sa;Database=tksqldb_train");
    SqlCommand command = new SqlCommand(sql, connection);
    connection.Open();
    SqlDataReader dr = command.ExecuteReader();
    if(dr.Read())
    {
    Response.Clear();
    Response.AddHeader("Content-Type","application/msword");
    Response.BinaryWrite((byte[])dr["st_nr"]);
    }
    dr.Close();
    connection.Close();
    这个是从数据库binary字段中读出来然后用ie打开的