Microsoft KB Archive/931419

= BUG: The XDocumentOpen event does not occur in an Office InfoPath 2007 managed add-in if you open an InfoPath 2007 form directly from Windows Explorer =

Article ID: 931419

Article Last Modified on 2/5/2007

-

APPLIES TO


 * Microsoft Office InfoPath 2007

-



SYMPTOMS
Consider the following scenario. You create a Microsoft Office InfoPath 2007 managed add-in. The add-in has code that executes on the XDocumentOpen event. You open a saved InfoPath XML file directly from Microsoft Windows Explorer by double-clicking a saved InfoPath XML file. In this scenario, the XDocumentOpen event does not occur.

Note If you first start InfoPath and then you open the form from Windows Explorer, the XDocumentOpen event occurs.



STATUS
Microsoft has confirmed that this is a bug in the Microsoft products that are listed in the &quot;Applies to&quot; section.



Steps to reproduce the issue
 Use Microsoft Visual Studio Tools for Office System (VSTO) to create an InfoPath add-in.  Add the following line of code to the Startup event handler: InfoPath.ApplicationEventsClass events = (InfoPath.ApplicationEventsClass)((InfoPath._Application3)Application).Events; events.XDocumentOpen += new Microsoft.Office.Interop.InfoPath._ApplicationEvents_XDocumentOpenEventHandler(events_XDocumentOpen);   Add the following event handler code example. void events_XDocumentOpen(Microsoft.Office.Interop.InfoPath._XDocument pDocument) {           MessageBox.Show(&quot;events_XDocumentOpen&quot;); }  Right-click the setup project, and then select Install. Press F5. Create a new template, and then save the template. Open the template, and then save the generated form.</li> Open the form by double-clicking the form in Windows Explorer.

The message box does not appear.</li></ol>

Additional query words: IP2007 InfoPath2007

Keywords: kbpending kbbug kbexpertiseinter kbtshoot KB931419

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.