Edit

Share via


MailEnvelope2.AttachmentType Property

Definition

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

public:
 property Microsoft::Office::Interop::InfoPath::SemiTrust::XdAttachmentType AttachmentType { Microsoft::Office::Interop::InfoPath::SemiTrust::XdAttachmentType get(); void set(Microsoft::Office::Interop::InfoPath::SemiTrust::XdAttachmentType value); };
public Microsoft.Office.Interop.InfoPath.SemiTrust.XdAttachmentType AttachmentType { get; set; }
member this.AttachmentType : Microsoft.Office.Interop.InfoPath.SemiTrust.XdAttachmentType with get, set
Public Property AttachmentType As XdAttachmentType

Property Value

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

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.<span class="label">CC</span> = "someone@example.com";
myEnv.BCC = "someone@example.com";
myEnv.Subject = "Test e-mail message";
myEnv.Intro = "This is the InfoPath form you requested.";
myEnv.<span class="label">AttachmentType</span> = XdAttachmentType.xdXmlXsn;

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

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

Because the AttachmentType property is new to Microsoft InfoPath, 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.

Applies to