Edit

Share via


FileSubmitConnection.Filename Property

Definition

Gets an XPathTypedValue that evaluates to the file name that the current form will be given when the form is submitted by the FileSubmitConnection object.

public:
 abstract property Microsoft::Office::InfoPath::XPathTypedValue ^ Filename { Microsoft::Office::InfoPath::XPathTypedValue ^ get(); };
public abstract Microsoft.Office.InfoPath.XPathTypedValue Filename { get; }
member this.Filename : Microsoft.Office.InfoPath.XPathTypedValue
Public MustOverride ReadOnly Property Filename As XPathTypedValue

Property Value

An XPathTypedValue that evaluates to the file name that the form will be given when it is submitted.

Examples

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.

FileSubmitConnection submitConnection = 
   (FileSubmitConnection)(DataConnections["SharePoint Library"]);
MessageBox.Show (submitConnection.Filename.ToString());
Dim submitConnection As FileSubmitConnection = 
   DirectCast(DataConnections["SharePoint Library"], _
   FileSubmitConnection)
MessageBox.Show (submitConnection.Filename.ToString())

Remarks

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(String) 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());
Dim submitConnection As FileSubmitConnection = 
   DirectCast(DataConnections["SharePoint Library"], _
   FileSubmitConnection)
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.

Applies to