Field
Object
A Field
object represents a property of an object. The Field object gives you the
ability to add or access properties of an AddressEntry, AddressEntryFilter,
Folder, Message, or MessageFilter object.
Quick Info
Specified
in header file: |
MDISP.ODL |
First
available in version: |
OLE
Messaging Library 1.0 |
Parent
objects: |
Fields collection |
Child objects:
|
(none) |
Default
property: |
Value |
Properties
|
Available
in version |
|
|
Application |
1.0 |
String |
Read-only |
Class |
1.0 |
Long |
Read-only |
ID |
1.0 |
Long |
Read-only |
Index |
1.0 |
Long |
Read-only |
Name |
1.0 |
String |
Read-only |
Parent |
1.0 |
Fields
collection object |
Read-only |
Session |
1.0 |
Session
object |
Read-only |
Type |
1.0 |
Integer |
Read-only |
Value |
1.0 |
Variant |
Read/write |
Methods
|
Available
in version |
|
|
|
|
|
|
|
Delete |
1.0 |
(none) |
|
|
|
|
|
|
ReadFromFile |
1.0 |
fileName as
String |
WriteToFile |
1.0 |
fileName as
String |
Remarks
You can add
additional properties tailored for your specific application with the Fields
collection object. Before adding a field for a Message, Folder, or AddressEntry
object, please review the properties that are already provided by the OLE
Messaging Library. Many of the most common attributes are already offered. For
example, Subject and Priority are already defined as Message
object properties.
Note that the
predefined MAPI properties are unnamed when they are accessed in Field objects.
For these MAPI properties, the Name property is an empty string.
The Field
object also supports multivalued MAPI properties. The multivalued property
appears to the Visual Basic application as a variant array; that is, you can
use the For ... Next statement to access individual array entries, as
shown in the following sample program.
Dim rgstr(0
To 9) As String
' Build
array of values for MV prop
For i = 0
To 9
rgstr(i) = "String" + Str(i)
Next
' Create
MV field on the message. Note that we don't specify
' the
array as third argument to Fields.Add, but add separately.
Set f =
msg.Fields.Add("FancyName", vbString + vbArray)
f.Value =
rgstr ' Set value of the new field.
'
Save/send the message, logoff, etc.
... ' code that reads the multivalued properties
Dim rgstr
As Variant
Set f =
msg.Fields.Item("FancyName") ' Get MV Field from the message
rgstr =
f.Value ' Get array of values into a
variant
For i =
LBound(rgret) To UBound(rgret)
MsgBox
rgret(i)
Next i
For more
information about MAPI properties, see the reference documentation for the
Fields Collection and the MAPI Programmer s Reference.
See Also
Fields
Collection