MailEnvelope2.AttachmentType Property

Gets or sets the type of file to be attached to the e-mail message.

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

Syntax

'Declaration
Property AttachmentType As XdAttachmentType
    Get
    Set
'Usage
Dim instance As MailEnvelope2
Dim value As XdAttachmentType

value = instance.AttachmentType

instance.AttachmentType = value
XdAttachmentType AttachmentType { get; set; }

Property Value

Type: Microsoft.Office.Interop.InfoPath.XdAttachmentType
An XdAttachmentType that specifies the type of file that is attached to the e-mail message.

Remarks

Set to XdAttachmentType.xdXml to send only the form file (.xml). Set to XdAttachmentType.xdXmlXsn to send the form file (.xml) along with its associated form template file (.xsn).

Examples

The following example sets a reference to the MailEnvelope2 object, sets envelope properties, and then displays the e-mail envelope.

MailEnvelope2 myEnv = 
   (MailEnvelope2)thisApplication.ActiveWindow.MailEnvelope;
myEnv.To = "someone@example.com";
myEnv.CC = "someone@example.com";
myEnv.BCC = "someone@example.com";
myEnv.Subject = "Test e-mail message";
myEnv.Intro = "This is the InfoPath form you requested.";
myEnv.AttachmentType = XdAttachmentType.xdXmlXsn;

// Display form with e-mail envelope.
myEnv.Visible = true;

See Also

Reference

MailEnvelope2 Interface

MailEnvelope2 Members

Microsoft.Office.Interop.InfoPath Namespace