COM 异常 0x800A11F9 - 无法激活应用程序 [英] COM Exception 0x800A11F9 - Cannot activate application

查看:33
本文介绍了COM 异常 0x800A11F9 - 无法激活应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 C# 2.0 (WinForms) 项目,我尝试在其中激活 word 2003(系统上安装了 word).通过使用以下代码:

I have a C# 2.0 (WinForms) project in which I try to activate word 2003 (word is installed on the system). By using the following code:

private void ActivateWord()
{
    this.Activate();

    if (m_WordDocument != null)
    {
        try
        {
            m_WordDocument.Activate();

            if (m_WordDocument.Application != null)
            {
                m_WordDocument.Application.Visible = true;
                m_WordDocument.Application.Activate();
            }
        }
        catch (COMException comEx)
        {
            ShowError(this, comEx.Message, false);
        }
    }
}

当我的应用程序执行 m_WordDocument.Application.Activate() 时,我收到一个 COM 异常 0x800A11F9.

When my application executes m_WordDocument.Application.Activate() I receive a COM Exception 0x800A11F9.

Stacktrace:
    "System.Runtime.InteropServices.COMException (0x800A11F9): Cannot activate application  
        at Word.ApplicationClass.Activate()  
        at Roxit.SquitXO.GUI.DocumentCreatie.frmSelectVeld.ActivateWord()"

这个问题的原因可能是什么?

What could be the cause of this problem?

推荐答案

COM error 0x800A11F9 is a 众所周知的权限问题,当低权限用户(例如网络服务)尝试激活Office应用程序时发生.

COM error 0x800A11F9 is a well-known permission problem that occurs when an underprivileged user (such as Network Service) tries to activate an Office application.

就您而言,问题不可能来自 IIS,因为您正在开发 WinForms 应用程序.相反,您的应用看起来像是由在 Local ServiceNetwork Service 用户帐户下运行的 Windows 服务启动的.

In your case, the problem can't come from IIS since you're developing a WinForms application. Rather, it looks like your app is started by a Windows service running under the Local Service or Network Service user account.

如果确实如此,您需要在服务属性对话框的登录选项卡中更改服务使用的用户帐户.

If that's indeed the case, you need to change the user account used by the service in the Log on tab of the service's properties dialog box.

您可能想尝试将激活 Word 的代码放入 COM+ 组件 并配置组件的身份,使其在可以启动 Word 的用户帐户下运行.

You might want to try putting the code that activates Word into a COM+ component and configuring the identity of the component so it runs under a user account that can launch Word.

这篇关于COM 异常 0x800A11F9 - 无法激活应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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