Subject Property (MailEnvelope Object)

Microsoft Office InfoPath

Sets or retrieves a string containing the subject value used in the MailEnvelope object that is associated with a Window object.

expression.Subject

expression    Required. An expression that returns a reference to the MailEnvelope object.

Security Level

2: 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.

Remarks

The MailEnvelope object does not support the programmatic creation of the body of an e-mail message. Users enter the body text after the e-mail message is displayed in the default e-mail editor.

Example

In the following example, the Subject property of the MailEnvelope object is used to set the subject value of a custom e-mail message:

function CreateMailEnvelope::OnClick(eventObj)
{
   var objEmail;

   objEmail = Application.ActiveWindow.MailEnvelope;
   objEmail.To = "[email protected]";
   objEmail.CC = "[email protected]";
   objEmail.BCC = "[email protected]";
   objEmail.Subject = "Test e-mail message";
   objEmail.Visible = true;
   objEmail = null;
}