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:

Fields0EU12H collection

Child objects:

(none)

Default property:

ValueRDXHN1

 

 

Properties

 
Property name

Available in version

 
Type

 
Access

Application5GI0QO

1.0

String

Read-only

Class1CT5_O0

1.0

Long

Read-only

ID1WDZE73

1.0

Long

Read-only

IndexAL3Z.V

1.0

Long

Read-only

Name1VN.FFH

1.0

String

Read-only

Parent13HN1VR

1.0

Fields collection object

Read-only

Session23X3PG

1.0

Session object

Read-only

TypeJ34I44

1.0

Integer

Read-only

ValueRDXHN1

1.0

Variant

Read/write

 

Methods

 
Method name

Available in version

 
Parameters

 

 

 

 

 

 

Delete2DPBZVU

1.0

(none)

 

 

 

 

 

 

ReadFromFile15TQUWG

1.0

fileName as String

WriteToFile2AR.S82

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 Collection0EU12H