Share via


XDocument.ImportFile Method

InfoPath Developer Reference

Imports the specified form into the current form.

Version Information
 Version Added:  InfoPath 2003

Syntax

expression.ImportFile(bstrFileURI)

expression   An expression that returns a XDocument object.

Parameters

Name Required/Optional Data Type Description
bstrFileURI Required String The Uniform Resource Identifier (URI) of the form 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 ImportFile method of the XDocument object is used to import a form:

JScript
  XDocument.ImportFile("C:\SomeOtherForm.xml");

See Also