This documentation is archived and is not being maintained.

MailEnvelope2.AttachmentType Property (Microsoft.Office.Interop.InfoPath.SemiTrust)

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

This property is not CLS-compliant.  

Namespace: Microsoft.Office.Interop.InfoPath.SemiTrust
Assembly: Microsoft.Office.Interop.InfoPath.SemiTrust (in

XdAttachmentType AttachmentType { get; set; }

Property Value

An XdAttachmentType that specifies the type of file that is attached to the e-mail message.

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).

Because the AttachmentType property is new to Microsoft Office InfoPath 2007, you must declare and cast to the MailEnvelope2 type to access this property. For more information, see How to: Use Object Model Members That Are Not Compatible with InfoPath 2003.

This member can be accessed without restrictions.

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

MailEnvelope2 myEnv = 
myEnv.To = "";
myEnv.CC = "";
myEnv.BCC = "";
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;