Share via


FormControl.Open Method (String)

Opens a form file (.xml) and loads it into the FormControl object.

Namespace:  Microsoft.Office.InfoPath
Assembly:  Microsoft.Office.InfoPath.FormControl (in Microsoft.Office.InfoPath.FormControl.dll)

Syntax

'Declaration
Public Overridable Sub Open ( _
    formLocation As String _
)
'Usage
Dim instance As FormControl
Dim formLocation As String

instance.Open(formLocation)
public virtual void Open(
    string formLocation
)

Parameters

  • formLocation
    Type: System.String

    The path or URL to the form file (.xml).

Remarks

The Open(System.String) method does not allow you to specify a form template file (.xsn). The form file must contain processing instructions (href and name attributes) that reference a valid form template file for the Load method to succeed. If this is not possible, the NewFromFormTemplate method can be used if you have a .xsn file and a suitably structured XML file, but the XML file does not have processing instruction references that specify the .xsn file. Or you can use the Open(Stream) method to load XML from a Stream object.

For more information about the FormControl object, see Hosting the InfoPath Form Editing Environment in a Custom Windows Form Application.

See Also

Reference

FormControl Class

FormControl Members

Open Overload

Microsoft.Office.InfoPath Namespace