Assembly: Microsoft.Office.InfoPath (in Microsoft.Office.InfoPath.dll)
The value of the Filename property of the FileSubmitConnection class is returned as an XPathTypedValue object, which can be set by specifying a literal string using the SetStringValue method of the XPathTypedValue class, or by specifying an XPath expression using the XPath property of the XPathTypedValue class. For more information and code samples, see the XPathTypedValue Class topic.
The ".xml" file name extension will be appended to the string if it is not already included. If the Filename property is a null reference (Nothing in Visual Basic), the form is given the name "Form.xml" when it is submitted.
If an XPath expression, such as concat("Status Report -", field1), has been specified in the File name box of the Data Connection Wizard when the data connection was defined, you can return that expression by using the XPath property of the XPathTypedValue class, as shown in the following example.
FileSubmitConnection submitConnection = (FileSubmitConnection)(DataConnections["SharePoint Library"]); MessageBox.Show (submitConnection.Filename.XPath.ToString());
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 from code running in forms opened in Microsoft InfoPath Filler or in a Web browser.
The following example uses the Filename property of the FileSubmitConnection object to display the file name that will be used when submitting the form to the data connection.