Share via


XmlForm.MergeForm Method (String)

Merges the current form with the form specified by path or URL.

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

Syntax

'Declaration
'Usage

Parameters

  • fileUrl
    The path or URL to the form file to merge.

Exceptions

Exception type Condition

ArgumentNullException

The value passed for fileUrl is null.

ArgumentException

The value passed for fileUrl is "" or is invalid.

InvalidOperationException

The MergeForm method was called from the Loading event.

Remarks

The MergeForm method is equivalent to using the Merge Forms command on the File menu. The value passed as the fileUrl parameter must be a full path or URL, and must include the filename with an .xml file extension.

Note

The MergeForm method provides similar functionality to the ImportFile method of the XDocument object in the COM/Scripting object model, and to the ImportFile method of the _XDocument2 interface of the InfoPath 2003-compatible managed code object model.

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.

This type or member can be accessed only from code running in forms opened in Microsoft Office InfoPath 2007.

Example

In the following example, the MergeForm method of the XmlForm class is used to merge a form with the current form.

this.MergeForm("C:\\MyForms\\SomeOtherForm.xml");
Me.MergeForm("C:\MyForms\SomeOtherForm.xml")

See Also

Reference

XmlForm Class
XmlForm Members
Microsoft.Office.InfoPath Namespace