Microsoft KB Archive/931418

From BetaArchive Wiki
< Microsoft KB Archive
Revision as of 18:36, 18 July 2020 by 3155ffGd (talk | contribs) (importing KB archive)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Knowledge Base


Application events may not occur if a managed COM add-in for InfoPath 2007 does not keep a reference to the Application.Events object

Article ID: 931418

Article Last Modified on 2/6/2007



APPLIES TO

  • Microsoft Office InfoPath 2007
  • Microsoft Visual Studio 2005 tools for the 2007 Microsoft Office System



SYMPTOMS

If a managed Microsoft Component Object Model (COM) add-in for Microsoft Office InfoPath 2007 does not keep a reference to the Application.Events object, application events may not occur.

WORKAROUND

To work around this issue, follow these steps to keep a reference to the Application.Events object:

Note The following steps use Microsoft Visual C#.

  1. Add the following member variable to the add-in:

    private Microsoft.Office.Interop.InfoPath.ApplicationEventsClass events;
  2. Add the following code example to the OnStartupComplete method.

    events = (Microsoft.Office.Interop.InfoPath.ApplicationEventsClass)applicationObject.Events;

Note When you no longer need a reference to this object, make sure that you add code to release the reference to the object from memory.

STATUS

This behavior is by design.


Additional query words: IP2007 InfoPath2007

Keywords: kbexpertiseinter kbtshoot kbprb KB931418