RJ.*_*RJ. 6 .net c# asp.net ms-word office-automation
我正在编写一个使用.dotx模板的程序,并在aspx页面中进行数据合并.该程序在我的开发工作站本地工作正常,但当我将它部署到测试IIS服务器时,它在下面的第二行失败,给我一个对象引用错误.
我之前遇到问题,因为Word Com对象不在IIS服务器上,因此我将Word加载到服务器上并在DCom中设置权限并解决了该问题.但现在我在以wRange = .....开头的行上出现此错误
正如我所说,该程序在调试模式下完美地工作.
有任何想法吗?
Microsoft.Office.Interop.Word.DocumentClass
System.NullReferenceException: Object reference not set to an instance of an object
Run Code Online (Sandbox Code Playgroud)
代码行:
Document BaseDocument = oWord.Documents.Open(ref oTemplate, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing);
wRange = BaseDocument.Bookmarks.get_Item(ref endOfDoc).Range;
Run Code Online (Sandbox Code Playgroud)
小智 6
有关“为远程访问配置 DCOM”的更多信息,请访问为远程访问配置 DCOM
| 归档时间: |
|
| 查看次数: |
4937 次 |
| 最近记录: |