Server Word 自动化权限(一些答案和一些问题)

发布于 2024-09-26 07:23:09 字数 1274 浏览 0 评论 0原文

我正在尝试使用Word自动化来计算Word文档中的页数。 到目前为止,我遇到了以下错误:

  1. 由于以下错误,检索 CLSID 为 {000209FF-0000-0000-C000-000000000046} 的组件的 COM 类工厂失败:80070005。

  2. 打开文档时 Word 卡住。

我目前的解决方案和迄今为止采取的步骤是:

  1. {A86A40B3-0008-4D41-975C-BB586C7121E3} 更改注册表项 [HKEY_CLASSES_ROOT\AppID\WINWORD.EXE] 更改为 {00020906-0000-0000-C000-000000000046}

  2. 在 DCOM 配置中 DCOMCNFG.EXE 进行了以下更改:

    • 在其 appID“{A86A40B3-0008-4D41-975C-BB586C7121E3}”下显示的“Microsoft Word 应用程序”中,向用户 iusr_ 授予本地午餐权限(仅限)并设置“启动用户”的身份。

    • 在“Microsoft Office Word 97 - 2003 文档”(也被某些人称为“Microsoft Word 文档”)(可能取决于 Word 版本)中,我向 iusr 和 iwam 授予了完全启动和访问权限,将身份验证级别设置为“无”,将启动用户设置为我自己的管理员用户。

“2-b”部分中所有 3 个 mod 的组合最终使所有这些考验得以实现,并且现在正在运行。 使用我自己的用户启动是为了响应打开文档时单词卡住的情况。 将身份验证设置回默认值会导致错误“1”。 将启动用户设置回“启动用户”会导致错误“2”。

目前的情况是,一切正常,但只有当我的用户登录并在计算机上处​​于活动状态时,我对必须使用自己的用户(必须登录)这一事实感到不高兴打开并且该身份验证设置为无。

我写这篇文章是为了那些像我一样努力工作好几天的人的答案,希望能得到一些关于如何提高安全性的答案,也就是删除启动用户并设置身份验证,而不是登录24 /7 到生产计算机(当网站启动时)。

开发机规格:
Windows XP 专业版 32 位
IIS 5.1
经典 ASP 网站
COM+ C# 对象执行自动化。

I am attempting to use word automation to count the number of pages in a word document.
So far i have faced these errors:

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

  2. Word stuck when opening a document.

My resolution at the moment and steps i took so far are:

  1. Change registry key [HKEY_CLASSES_ROOT\AppID\WINWORD.EXE] from {A86A40B3-0008-4D41-975C-BB586C7121E3} to {00020906-0000-0000-C000-000000000046}.

  2. In DCOM config DCOMCNFG.EXE made the following changes:

    • In "Microsoft Word Application" displayed under its appID "{A86A40B3-0008-4D41-975C-BB586C7121E3}" gave user iusr_<MACHINE_NAME> local lunch permissions (only) and set identity to "The launching user".

    • In "Microsoft Office Word 97 - 2003 Document" also known by some as "Microsoft Word Document" (probably depends on word version) i gave full launch and access permission to both iusr and iwam, set Authentication level to "None", set launching user to my own admin user.

The combination of all 3 mods in section "2-b" finally made all this ordeal work and is now functioning.
Using my own user for launching came as response to word getting stuck when opening a document.
Setting authentication back to default results in error "1".
Setting launching user back to "The launching user" results in error "2".

The current situation is that all is working but only when my user is logged on and active on the machine and i am not thrilled by the fact that i have to use my own user that is has to be logged on and that authentication is set to none.

I am writing this as an answer for those struggling as me for days to get this working and hopefully to get some answers to how i might improve on security, aka remove launching user and set back authentication, and not be logged on 24/7 to the production machine (when the site launches).

Specification of development machine:
Windows XP Pro 32bit
IIS 5.1
Classic ASP Website
COM+ C# object doing the automation.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

春夜浅 2024-10-03 07:23:09

避免用户 24/7 全天候登录的解决方案是在调用 Word 之前模拟该帐户并以编程方式加载用户配置文件(为此,该帐户需要本地管理员)。

另一个解决方案是构建一个具有相同功能的 Windows 服务。

A solution to avoid having the user logged 24/7 is to impersonate the account and load the user profile programmatically (for this the account needs to a local administrator) before calling Word.

Another solution is to build a windows service that does the same.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文