FormControl.NewFromFormTemplate Method (String, Stream, XmlFormOpenMode)
Creates a new form based on the specified form template (.xsn) and the data contained in an XML stream.
Namespace: Microsoft.Office.InfoPath
Assembly: Microsoft.Office.InfoPath.FormControl (in Microsoft.Office.InfoPath.FormControl.dll)
Syntax
'Declaration
Public Overridable Sub NewFromFormTemplate ( _
formTemplateLocation As String, _
xmlDataStream As Stream, _
behavior As XmlFormOpenMode _
)
'Usage
Dim instance As FormControl
Dim formTemplateLocation As String
Dim xmlDataStream As Stream
Dim behavior As XmlFormOpenMode
instance.NewFromFormTemplate(formTemplateLocation, _
xmlDataStream, behavior)
public virtual void NewFromFormTemplate(
string formTemplateLocation,
Stream xmlDataStream,
XmlFormOpenMode behavior
)
Parameters
formTemplateLocation
Type: System.StringThe path or URL to the form template file (.xsn).
xmlDataStream
Type: System.IO.StreamThe file stream (Stream) containing the XML data used to populate the new form.
behavior
Type: Microsoft.Office.InfoPath.XmlFormOpenModeAn XmlFormOpenMode value that specifies how the form should be opened.
Remarks
For more information about the FormControl object, see Hosting the InfoPath Form Editing Environment in a Custom Windows Form Application.