The Value property specifies the value of a field.
Type: | Variant |
Run time: | Read-write |
object.Value
Syntax Element | Description |
object | Field (MSMQMailFormField) object that represents the field of the form. |
String, Integer, Boolean, Double, or Currency value of field.
This example defines an e-mail form that has three fields (String, Boolean, and Date). Then composes a message body and displays the values of each field.
To try this example using Microsoft Visual Basic (version 5.0), paste the code into the Code window of a form, then 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 'Add primary recipient. email.Recipients.Add "Exchange_User", "ExchangeUser@ServerInputQueueLabel", MSMQMAIL_RECIPIENT_TO 'Set who sent the e-mail. email.Sender.Name = "Our name" email.Sender.Address = "Our queue label" 'Set subject of mail. email.Subject = "Test form." '*************** '* Define form '*************** 'Set form name emaile.FormData.Name = "Our name" 'Set form field list. email.FormData.FormFields.Add "StringField", "Test String" email.FormData.FormFields.Add "BooleanField", True email.FormData.FormFields.Add "DateField", "Current Date" '*********************** '* Compose mail message. '*********************** msq.Body = email.ComposeBody '********************* '* Display Recipients. '********************* Dim formfield As MSMQMailFormField For Each formfield In email.FormData.FormFields MsgBox "Form: " + formfield.Name + " = " + CStr(formfield.Value) Next formfield End Sub
Add, Address, Body, ComposeBody, ContentType, FormData, FormFields, MSMQMailEMail, MSMQMessage, Name, Recipients, Sender, Subject