Office 2007编程错误 [英] Error in office 2007 programming

查看:448
本文介绍了Office 2007编程错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我们有一个使用Word 2007打开文件并将其发布为PDF的ASP.NET应用.当我们在Visual Studio 2008中的Debug中运行它时,此方法工作正常,但是当我们将其作为普通网站运行时,会出现以下错误:

Hi
We have a ASP.NET app that uses the Word 2007 to open a file and publish it as a PDF. This works fine when we run it in Visual Studio 2008 in Debug, but when we run it as a normal website we get the following error:

System.UnauthorizedAccessException: Retrieving the COM class factory for component with CLSID {000209FF-0000-0000-C000-000000000046} failed due to the following error: 80070005.


我们一直在寻找解决方案已有2天,并且已授予ASPNET访问DLL的权限.
当我们将模拟设置放入web.config并为其指定用户名和密码后,该错误消失了,但被替换为:


We have been looking for a solution for 2 days and we have given ASPNET access to the DLL.
When we put Impersonation into web.config and given it a Username and password this error went away, but was replaced by:

System.NullReferenceException: Object reference not set to an instance of an object.


因此,尽管它似乎使我们能够解决安全问题,但实际上并没有实例化Word使其看起来似乎过时.

有人对我们有帮助吗?我们正在IIS7上进行开发,并在计算机上安装了Word2007.


So while it seems to get us around the security problem, it is not actually instantiating the Word obect it would seem.

Does anyone have any help for us? We are developing on IIS7 with Word2007 intalled on the machine.

推荐答案

是否可能是运行代码的帐户没有COM操作所需的特权.使用dcomcnfg.exe来检查必要的特权.

还可以查看此对话: http://www.codeguru. com/forum/printthread.php?t = 383912& page = 3& pp = 15 [
Could it be that the account running the code does not have necessary privileges for COM operations. Use dcomcnfg.exe to check the necessary privileges.

Also have a look at this conversation: http://www.codeguru.com/forum/printthread.php?t=383912&page=3&pp=15[^]


Win Server 2008上的IIS7?
在" C:\ Windows \ SysWOW64 \ config \ systemprofile \ "内部创建一个新的"桌面"目录,并授予修改网络服务和用户组"的权限.
IIS7 on Win Server 2008 ?
Create a new "Desktop" directory inside of "C:\Windows\SysWOW64\config\systemprofile\" and give access Modify of NetworkServices and User group.


这篇关于Office 2007编程错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆