• <bdo id='3l2cH'></bdo><ul id='3l2cH'></ul>
  1. <i id='3l2cH'><tr id='3l2cH'><dt id='3l2cH'><q id='3l2cH'><span id='3l2cH'><b id='3l2cH'><form id='3l2cH'><ins id='3l2cH'></ins><ul id='3l2cH'></ul><sub id='3l2cH'></sub></form><legend id='3l2cH'></legend><bdo id='3l2cH'><pre id='3l2cH'><center id='3l2cH'></center></pre></bdo></b><th id='3l2cH'></th></span></q></dt></tr></i><div id='3l2cH'><tfoot id='3l2cH'></tfoot><dl id='3l2cH'><fieldset id='3l2cH'></fieldset></dl></div>
    1. <tfoot id='3l2cH'></tfoot>

    2. <legend id='3l2cH'><style id='3l2cH'><dir id='3l2cH'><q id='3l2cH'></q></dir></style></legend>

      <small id='3l2cH'></small><noframes id='3l2cH'>

      生成 Word 文档时检索 COM 类工厂的组件错误

      Retrieving the COM class factory for component error while generating word document(生成 Word 文档时检索 COM 类工厂的组件错误)
        <tfoot id='4Gxy7'></tfoot>

        <small id='4Gxy7'></small><noframes id='4Gxy7'>

      • <i id='4Gxy7'><tr id='4Gxy7'><dt id='4Gxy7'><q id='4Gxy7'><span id='4Gxy7'><b id='4Gxy7'><form id='4Gxy7'><ins id='4Gxy7'></ins><ul id='4Gxy7'></ul><sub id='4Gxy7'></sub></form><legend id='4Gxy7'></legend><bdo id='4Gxy7'><pre id='4Gxy7'><center id='4Gxy7'></center></pre></bdo></b><th id='4Gxy7'></th></span></q></dt></tr></i><div id='4Gxy7'><tfoot id='4Gxy7'></tfoot><dl id='4Gxy7'><fieldset id='4Gxy7'></fieldset></dl></div>
        <legend id='4Gxy7'><style id='4Gxy7'><dir id='4Gxy7'><q id='4Gxy7'></q></dir></style></legend>

            • <bdo id='4Gxy7'></bdo><ul id='4Gxy7'></ul>

                <tbody id='4Gxy7'></tbody>
                本文介绍了生成 Word 文档时检索 COM 类工厂的组件错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                我正在尝试使用大部分代码从 VB.NET 编辑 word 文档:

                I am trying to edit a word document from VB.NET using for the most part this code:

                如何从 Visual Basic .NET 自动化 Word 以创建新文档http://support.microsoft.com/kb/316383

                它在我的机器上运行良好,但是当我发布到服务器时出现以下错误.

                It works fine on my machine but when i publish to the server i get the following error.

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

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

                说明:在执行过程中发生未处理的异常执行当前的 Web 请求.请查看堆栈跟踪以获取更多信息有关错误和位置的信息它起源于代码.

                Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

                异常详情: System.UnauthorizedAccessException:检索 COM 类工厂具有 CLSID 的组件{000209FF-0000-0000-C000-000000000046}由于以下错误而失败:80070005.

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

                当我尝试只创建一个 word 应用程序对象时发生实际错误

                The actual error happens when i try to just create a word application object

                 Dim oWord As New Word.Application
                

                使用 Visual Studio 2008 和 VB.NET 3.5.我参考了Microsoft Word 10.0 对象库",并在 bin 目录中看到了 Interop.Word.dll 文件.

                Using Visual Studio 2008 and VB.NET 3.5. I made a reference to the "Microsoft Word 10.0 Object Library" and i see Interop.Word.dll file in the bin directory.

                在开发机器和 Windows Server 2003 上使用 MS Office 2003

                Using MS Office 2003 on development machine and Windows Server 2003

                对于 .NET 来说还是个新手,对窗口服务器了解不多,但UnauthorizedAccessException"听起来像是权限问题.我想知道是否有人可以指出我可能需要做些什么来让我的小应用程序访问使用 word 的正确方向.

                Still fairly new to .NET and don't have much knowledge about window server, but "UnauthorizedAccessException" sounds like a permission issue. I'm wondering if someone could point me in the right direction on what i might need to do to give my little application access to use word.

                推荐答案

                听起来绝对是权限问题.您是否在 Windows 服务中运行代码?该服务通常作为本地系统运行,它可能没有访问 Word 对象模型的权限.此外,如果 word 已经使用其他用户的凭据运行,那么您的程序可能无法使用不同的凭据通过 COM 访问它.办公应用程序往往是单一实例,这似乎加剧了这个问题.

                It definitely sounds like a permissions problem. Are you running your code in a windows service? The service normally runs as Local System, which may not have permission to access the Word object model. Additionally, if word is already running using the credentials of some other user then your program may not be able to access it via COM using different credentials. The office applications tend to be single instance which seems to exacerbate this problem.

                这篇关于生成 Word 文档时检索 COM 类工厂的组件错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                相关文档推荐

                Extract Display name and description Attribute from within a HTML helper(从 HTML 帮助器中提取显示名称和描述属性)
                Attribute to generate compilation error on method call?(在方法调用上生成编译错误的属性?)
                What#39;s the difference between [Computed] and [Write(false)] attributes?([Computed] 和 [Write(false)] 属性有什么区别?)
                Allow a custom Attribute only on specific type(仅在特定类型上允许自定义属性)
                What was the Historical Precursor for .NET Attributes?(.NET 属性的历史前身是什么?)
                How do I GetCustomAttributes?(如何获取自定义属性?)

                    <tfoot id='MQjuI'></tfoot>

                    <small id='MQjuI'></small><noframes id='MQjuI'>

                      <tbody id='MQjuI'></tbody>

                    1. <i id='MQjuI'><tr id='MQjuI'><dt id='MQjuI'><q id='MQjuI'><span id='MQjuI'><b id='MQjuI'><form id='MQjuI'><ins id='MQjuI'></ins><ul id='MQjuI'></ul><sub id='MQjuI'></sub></form><legend id='MQjuI'></legend><bdo id='MQjuI'><pre id='MQjuI'><center id='MQjuI'></center></pre></bdo></b><th id='MQjuI'></th></span></q></dt></tr></i><div id='MQjuI'><tfoot id='MQjuI'></tfoot><dl id='MQjuI'><fieldset id='MQjuI'></fieldset></dl></div>

                          <bdo id='MQjuI'></bdo><ul id='MQjuI'></ul>
                          <legend id='MQjuI'><style id='MQjuI'><dir id='MQjuI'><q id='MQjuI'></q></dir></style></legend>