tags:

views:

193

answers:

2

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);
        }
    }
}

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?