Export (0) Print
Expand All

DocEventObject Interface (Microsoft.Office.Interop.InfoPath)

An event object that is used during a Microsoft Office InfoPath 2007 merge or view switching event.

Namespace: Microsoft.Office.Interop.InfoPath
Assembly: Microsoft.Office.Interop.InfoPath (in microsoft.office.interop.infopath.dll)

public interface DocEventObject : DocEvent

This type is a wrapper for a coclass that is required by managed code for COM interoperability. Use this type to access the members of the COM interface implemented by this coclass. For information about the COM interface, including a link to descriptions of its members, see DocEvent.

The DocEvent object provides the XDocument property that can be used within a merge or view switching event to programmatically interact with the data in a form's underlying XML document.

The DocEvent object is passed as a parameter to the OnSwitchView and OnAfterImport events of an InfoPath form. The XDocument property that it provides is available only during these events.

In the following example, the XDocument property of the DocEvent object is used to display the source XML of a form's underlying XML document using the DOM property of the XDocument object:

public void OnSwitchView(DocEvent e)
{
 thisXDocument.UI.Alert("The source XML: " + e.XDocument.DOM.xml);
}

Community Additions

ADD
Show:
© 2015 Microsoft