Edit

Share via


DocActionEvent.Source Property

Definition

Gets a reference to the inner-most XML Document Object Model (DOM) node of a form's underlying XML document.

public:
 property Microsoft::Office::Interop::InfoPath::SemiTrust::IXMLDOMNode ^ Source { Microsoft::Office::Interop::InfoPath::SemiTrust::IXMLDOMNode ^ get(); };
public Microsoft.Office.Interop.InfoPath.SemiTrust.IXMLDOMNode Source { get; }
member this.Source : Microsoft.Office.Interop.InfoPath.SemiTrust.IXMLDOMNode
Public ReadOnly Property Source As IXMLDOMNode

Property Value

Examples

In the following example, the Source property of the DocActionEventObject object is used to display the source XML data of the inner-most XML Document Object Model (DOM) node of the form's underlying XML document, which contains the button:

[InfoPathEventHandler(MatchPath="ShowDocActionEventSource", EventType=InfoPathEventType.OnClick)]
public void ShowDocActionEventSource_OnClick(DocActionEvent e)
{
 thisXDocument.UI.Alert("Source: " + e.<span class="label">Source</span>.xml);
}

In the following example, the Source property of the DocActionEventObject object is used to display the source XML data of the XML DOM node in a message box:

[InfoPathEventHandler(MatchPath="DocActionEventSource", EventType=InfoPathEventType.OnClick)]
public void DocActionEventSource_OnClick(DocActionEvent e)
{
 thisXDocument.UI.Alert("Source: " + e.<span class="label">Source</span>.xml);
}

Remarks

After you have set a reference to the XML DOM node that the Source property returns, you can use any of the properties and methods that are supported by the XML DOM.

Important: This member can be accessed only by forms running in the same domain as the currently open form, or by forms that have been granted cross-domain permissions.

Applies to