FormFields
MSMQMailFormData

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

Quick Info

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, then 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, and then 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
 

See Also

Add, Address, ComposeBody, ContentType, FormFields, MSMQMailEMail, MSMQMessage, Name, Recipients, Sender, Subject


© 1997 by Microsoft Corporation. All rights reserved.