DocEventObject Interface

Definition

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

public interface class DocEventObject : Microsoft::Office::Interop::InfoPath::SemiTrust::DocEvent
[System.Runtime.InteropServices.Guid("096cd613-0786-11d1-95fa-0080c78ee3bb")]
public interface DocEventObject : Microsoft.Office.Interop.InfoPath.SemiTrust.DocEvent
type DocEventObject = interface
    interface DocEvent
Public Interface DocEventObject
Implements DocEvent
Attributes
Implements

Examples

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:

// The following function handler is created by Microsoft Office InfoPath. Do not
// modify the type or number of arguments.
[InfoPathEventHandler(EventType=InfoPathEventType.OnSwitchView)]
public void OnSwitchView(<span class="label">DocEvent</span> e)
{
 thisXDocument.UI.Alert("The source XML: " + e.XDocument.DOM.xml);
}

Remarks

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, seeDocEvent.

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.

Properties

XDocument

Gets a reference to the XDocument object that is associated with the DocEventObject object during an OnSwitchView or OnAfterImport event.

(Inherited from DocEvent)

Applies to