Share via


XDocument.ImportDOM Method

InfoPath Developer Reference

Imports the specified XML data into the current form.

Version Information
 Version Added:  InfoPath 2003

Syntax

expression.ImportDOM(pxDoc)

expression   An expression that returns a XDocument object.

Parameters

Name Required/Optional Data Type Description
pxDoc Required [IXMLDOMDOCUMENT] The XML data that is to be imported (merged) into the currently open form.

Return Value
Nothing

Remarks

Using the object model to import a form programmatically is equivalent to performing a merge operation using the Merge Forms command on the File menu in InfoPath.

Security Level 2: 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.

Example

In the following example, the ImportDOM method of the XDocument object is used to import a form from the OnMergeRequest event handler:

JScript
  XDocument::OnMergeRequest(eventObj) 
{
    XDocument.ImportDOM eventObj.DOM);
    eventObj.ReturnStatus = true;
}

See Also