NewFromSolutionWithData Method
InfoPath Developer Reference |
Creates a new Microsoft Office InfoPath 2007 form using the specified XML data and form template.
Version Information
Version Added: InfoPath 2003
Syntax
expression.NewFromSolutionWithData(varXMLData, varSolutionURI, dwBehavior)
expression An expression that returns a XDocuments collection.
Parameters
Name | Required/Optional | Data Type | Description |
---|---|---|---|
varXMLData | Required | Variant | Provides the XML data to be used as a template for the form. Can be a string that specifies the Uniform Resource Identifier (URI) of an XML document, or an XMLDOMNode that contains the XML to be used as the XML document (template). |
varSolutionURI | Required | Variant | String which specifies the Uniform Resource Identifier (URI) of a form template file (an .xsf or .xsn file). |
dwBehavior | Optional | Long | Reserved for future use. This value should be omitted or set to 1. |
Return Value
XDocument
Remarks
The following related methods of the XDocuments collection are also available:
The New method enables creating a new instance of InfoPath by using a specified XML document. The XML document must correspond to an InfoPath form. A new form is opened in InfoPath, using the supplied XML document as initial data, and its associated form template as specified in the processing instructions in the header of the document.
The NewFromSolution method enables creating a new instance of InfoPath using a specified form template, and its associated XML form (the initial template data).
The NewFromSolutionWithData method supports a scenario that is not provided by the foregoing two methods: specifying both the XML document used as initial data and the form template. The XML document does not need to have been created by InfoPath. It can be supplied either as a URI or as an XMLDOMNode.
When you use the NewFromSolutionWithData method, the new form opens in InfoPath and is ready to be filled out.
Note |
---|
When the NewFromSolutionWithData method is used to create a new form based on a form template, any File Attachment controls in the form will be disabled until the form is saved and reopened. |
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 NewFromSolutionWithData method of the XDocuments collection is passed the URIs of an existing XML document, and an existing form template, and a new form is created and its associated XDocument object is returned:
JScript |
---|
|
In the following example, the NewFromSolutionWithData method of the XDocuments collection is passed an XMLDOMNode as initial data and the URI of an existing form, and a new form is created and its associated XDocument object is returned:
JScript |
---|
|
See Also