Name
MSMQMailFormData    MSMQMailFormField    MSMQMailRecipient

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

Syntax for Form Name

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.

Syntax for Field Name

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.


Syntax for Sender Recipient Name

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.

Syntax for Recipient Name (in Recipient List)

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.


Settings

String that specifies the name of the form, form field, or e-mail recipient.

Remarks

Form Name
When sending a form to a Microsoft Exchange user, this name should match the name of the field's Item Type as specified in the Exchange Form Designer. The Item Type can be found on the General page of the Field Properties dialog box of the Exchange Form Designer. If they do not match, Microsoft Exchange may not display the form correctly.
Form Field Name
When used to specify the field of a form, this name should correspond to the name of the field's Reference Name as specified in the Exchange Form Designer. The Reference Name can be found on the General page of the Field Properties dialog of the Exchange Form Designer

If the correct Reference Name is not used, Microsoft Exchange may not display the field correctly.

E-mail Recipient Name
When used to specify an e-mail user, Name is only used for display purposes. It should contain the full name of the user.

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.

Example

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
 

QuickInfo

  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.

See Also

Add, Address, Body, ComposeBody, ContentType, FormData, FormFields, Item, MSMQMailEMail, MSMQMessage, Recipients, Sender, Subject