The Name property identifies the name of a form (MSMQMailFormData), the name of a field on a form (MSMQMailFormField), or the name of an e-mail recipient (MSMQMailRecipient).
Type: | String |
Run time: | Read-write |
object1.object2.Name
Syntax Element | Description |
---|---|
object1 | An e-mail (MSMQMailEMail) object that defines an e-mail message. |
object2 | Form data (MSMQMailFormData) object that defines the form. |
object1.object2.object3.Item(IndexKey),Name
Syntax Element | Description |
---|---|
object1 | An e-mail (MSMQMailEMail) object that defines an e-mail message. |
object2 | Form data (MSMQMailFormData) object that defines the form. |
object3 | Form field (MSMQMailFormField) object that defines the field. |
IndexKey | Specifies the position in the field list or a specific field key. Numeric indexes range from 1 to Count. Keys are added when the field is added to the list. |
object1.object2.Name
Syntax Element | Description |
---|---|
object1 | An e-mail (MSMQMailEMail) object that defines an e-mail message. |
object2 | Recipient (MSMQMailRecipient) object that defines the e-mail user. |
object1.object2.Item(IndexKey).Name
Syntax Element | Description |
---|---|
object1 | An e-mail (MSMQMailEMail) object that defines an e-mail message. |
object2 | Recipients (MSMQMailRecipientList) object that defines the list of e-mail users. |
IndexKey | Specifies the position in the recipient list or a specific field key. Numeric indexes range from 1 to Count. Keys are added when the recipient is added to the list. |
String that specifies the name of the form, form field, or e-mail recipient.
If the correct Reference Name is not used, Microsoft Exchange may not display the field correctly.
Name is explicitly referenced to name the sender recipient. However, it is not referenced explicitly when naming a recipient in the recipient list. In these cases, the name is set when adding the recipient to the recipient list.
This example defines an e-mail message as a form, setting the sender's name to "Our name", the recipient's name to "Exchange user", the form name to "Test form", and the field name to "StringField". Then a message body is composed and all names are displayed.
To try this example using Microsoft Visual Basic (version 5.0), paste the code into the Code window of a form, run the example, and click the form.
Dim email As New MSMQMailEMail
Dim msg As New MSMQMessage
Private Sub Form_Click()
'*********************
'* Define e-mail
'*********************
'Set e-mail type to form message.
email.ContentType = MSMQMAIL_EMAIL_FORM
'Set who sent the e-mail.
email.Sender.Name = "Our name"
email.Sender.Address = "Our queue label"
'Add Recipients.
email.Recipients.Add "Exchange user", "UserAlias@ServerInputQueueLabel", MSMQMAIL_RECIPIENT_TO, "Test"
'Set subject of mail.
email.Subject = "Test mail"
'***************
'* Define form
'***************
'Set name of form
email.FormData.Name = "Test form"
'Set form field list.
email.FormData.FormFields.Add "StringField", "Test Field", "Test"
'Compose message Body
msg.Body = email.ComposeBody
'*****************
'* Display names.
'*****************
MsgBox "Form name: " + email.FormData.Name
MsgBox "Field name is: " + email.FormData.FormFields.Item("test").Name
MsgBox "Sender recipient is: " + email.Sender.Name
MsgBox "To recipient is: " + email.Recipients.Item("test").Name
End Sub
Windows NT: Requires version 4.0 SP3 or later.
Windows: Requires Windows 95 or later.
Windows CE: Unsupported.
Import Library: Included as a resource in mqmailoa.dll.
Unicode: Defined only as Unicode.
Add, Address, Body, ComposeBody, ContentType, FormData, FormFields, Item, MSMQMailEMail, MSMQMessage, Recipients, Sender, Subject