FormFields
MSMQMailFormData

The FormFields property specifies a list of the fields in the e-mail form.

Type: MSMQMailFormFieldList
Run time: Read-write

Syntax

object1.object2.FormFields
 
Syntax Element Description
object1 E-mail message (MSMQMailEMail) object that defines the e-mail message.
object2 The form data (MSMQMailFormData) object that defines the form.

Settings

MSMQMailFormFieldList object.

Remarks

The MSMQMailFormFieldList object specifies all the fields in the form.

Example

This example defines an e-mail form with three fields, composes the body of an MSMQ mail message, and displays a name of the form plus the number of fields in the form.

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.

Option Explicit
Dim email As New MSMQMailEMail
Dim msg As New MSMQMessage

Private Sub Form_Click()

   '*********************
   '*  Define e-mail
   '*********************

   'Set e-mail type as form.
   email.ContentType = MSMQMAIL_EMAIL_FORM
   
   'Set who receives the e-mail.
   email.Recipients.Add "RecipientName", "RecipientQueueLabel", MSMQMAIL_RECIPIENT_TO

   'Set who sent the e-mail.
   email.Sender.Name = "Our name"
   email.Sender.Address = "Our queue label"

   'Set the subject of the e-mail.
   email.Subject = "Test mail."

   '**********************
   '* Define the form.
   '**********************

   'Set the form name.
   email.FormData.Name = "Test Form"

   'Set fields of form
   email.FormData.FormFields.Add "Field1", "Field1 text."
   email.FormData.FormFields.Add "Field2", True
   email.FormData.FormFields.Add "Field3", Date

   '******************************
   'Compose the mail message Body.
   '******************************
   msg.Body = email.ComposeBody
   
   MsgBox "Defined the form " + email.FormData.Name + " with " + CStr(email.FormData.FormFields.Count) + " fields."

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, ComposeBody, ContentType, FormFields, MSMQMailEMail, MSMQMessage, Name, Recipients, Sender, Subject