EmailAdapter.AttachmentFileName Property

Gets or sets the file name to be used for the current form when the form is attached to the e-mail message of an EmailAdapterObject object.

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

Syntax

'Declaration
Property AttachmentFileName As String
    Get
    Set
'Usage
Dim instance As EmailAdapter
Dim value As String

value = instance.AttachmentFileName

instance.AttachmentFileName = value
string AttachmentFileName { get; set; }

Property Value

Type: System.String

Remarks

The ".xml" file name extension will be appended to the string if it is not already included.

If the AttachmentFileName property is set to a null reference (Nothing in Visual Basic), the form will not be attached to the e-mail message.

Examples

This example shows how to use the AttachmentFileName property of an instance of the EmailAdapterObject object to change the name of the form when it is attached to the e-mail message before the EmailAdapterObject object is submitted. This example requires myEmailAdapter to reference an e-mail message Data Connection established in the design mode window of InfoPath, and two variables, strName and strDate, which set the name of the file attachment:

myEmailAdapter.AttachmentFileName = strName + "–" + strDate + ".xml"; 

See Also

Reference

EmailAdapter Interface

EmailAdapter Members

Microsoft.Office.Interop.InfoPath Namespace