Fields Property (IBodyPart)

Topic Last Modified: 2006-06-13

The Fields collection for the object. This property is read-only.

Applies To

IBodyPart Interface

Type Library

Microsoft CDO for Exchange 2000 Library

DLL Implemented In

CDOEX.DLL

Syntax

Property Fields As ADODB.Fields
HRESULT get_Fields(Fields** pVal);

Parameters

  • pVal
    Returned reference to the objects Fields collection.

Remarks

The Microsoft® ActiveX® Data Objects (ADO) Fields object is a collection of ADO Field objects that pertain to this object. Each Field object holds a name/value pair defining some header field for the body part. The name is always a string, and the value is a VARIANT. The subtype of the VARIANT depends on the field definition. See the appropriate section of the reference for a list of valid fields to use along with a list of the VARIANT subtypes for each field.

The fields that resize in this collection depend on the specific implementation. Consult the appropriate Component Object Model (COM) class for details about available fields.

Note

When you use the ADO Fields.Update method, field values are updated only in memory. You must call Save Method to save the changes to the Exchange store. To get the IDataSource interface, use the GetInterface method on the Collaboration Data Objects (CDO) object. This code is shown in the following example.

Example


Dim iMsg As New CDO.Message
Dim iBp As CDO.BodyPart
Set iBp = Msg

Dim Flds As ADODB.Fields
Set Flds = iBp.Fields

With Flds
   .Item("urn:schemas:mailheader:content-type") = "application/msword"
   .Item("urn:schemas:mailheader:content-disposition") = "attachment"
   .Update
End With

' Save the fields to the Exchange store
Dim iDsrc As CDO.IDataSource
Set iDsrc = iBp.GetInterface("IDataSource")
iDsrc.Save

See Also

Other Resources

CDO BodyPart Fields and Streams