Microsoft.Office.Interop.Word._Document doc = wordApp.Documents.Add(ref path, ref Nothing, ref Nothing, ref Nothing);
打开一个模板文件,报错:内存不足,请现在保存文档。如果新建一个文档,没问题。
这个如何解决?doc.SaveAs(ref path, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing,
                ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing);报命令失败错误。
如何解决?这些代码在其它地方执行正常。

解决方案 »

  1.   

    .net默認情況下一般只能4M.
    你也可以通過修改Web.config來改變大小
      

  2.   

    web.config设置是不是有问题
      去看看 web.config设置
      

  3.   

    web.config 里面<identity impersonate="true" userName="administrator" password="admin"/>     再运行IIS程序,应该没问题了!
      

  4.   


    我用的是“服务”,不是WEB。
      

  5.   

    服务里可以使用word,Excel吗?要做什么设置么?
    高手麻烦回答一下。
      

  6.   

    服务有一个属性的--“允许服务与桌面交互”,使用Word的话,在注册服务时应该设置为“允许与桌面交互”。看看是不是和这个选项有关。
      

  7.   


    和这个没关,是WINDOWS服务。