Share via


Fields Property (InfoStore Object)

Fields Property (InfoStore Object)

The Fields property returns a single Field object or a Fields collection object. Read-only.

Syntax

objInfoStore.Fields

objInfoStore.Fields(index)

objInfoStore.Fields(proptag)

objInfoStore.Fields(name)

index

Integer. Value must be greater than 0 and less than or equal to 65,535 (&HFFFF). Specifies the index within the Fields collection.

proptag

Long. Value must be greater than or equal to 65,536 (&H10000). Specifies the property tag value for the MAPI property to be retrieved.

name

String. Specifies the name of the custom MAPI property.

Data Type

Object (Field or Fields collection)

Remarks

The Fields property returns one or all of the fields associated with an InfoStore object. Each field typically corresponds to a MAPI property. Data types are preserved, except that MAPI counted binary properties are converted to and from character strings representing hexadecimal digits.

The Fields property provides a generic access mechanism that allows Microsoft® Visual Basic® and Microsoft® Visual C++® programmers to retrieve the value of a MAPI property using either its name or its MAPI property tag. For access with the property tag, use objInfoStore.Fields(proptag), where proptag is the 32-bit MAPI property tag associated with the property, such as CdoPR_STORE_SUPPORT_MASK. To access a named property, use objInfoStore.Fields(name), where name is a string that represents the custom property name.

Although the Fields property itself is read-only, the collection it returns can be accessed in the normal manner through its Add and Delete methods, and the properties on its member Field objects retain their respective read/write or read-only accessibility.

The Fields(name) syntax is not supported by all message store providers. An InfoStore that does not support named properties returns CdoE_NO_SUPPORT for this syntax.

If your application is running as a Microsoft Windows NT® service, you cannot access the Microsoft Exchange Public Folders through the normal hierarchy because of a notification conflict. You must use the InfoStores Fields property to obtain the Microsoft Exchange property PR_IPM_PUBLIC_FOLDERS_ENTRYID, property tag &H66310102. This represents the top-level public folder and allows you to access all other public folders through its Folders property.

Example

This code fragment accesses the root of the Public Folders subtree of a message store:

Dim objSess As Session ' assume logged on to valid session
Dim objInfoStore As InfoStore ' assume opened and valid
Dim strPFRootID As String ' binary entry ID returned as hex string
Dim objPFRoot As Folder ' root folder of Public Folders
tagPFRootID = &H66310102 ' PR_IPM_PUBLIC_FOLDERS_ENTRYID
strPFRootID = objInfoStore.Fields(tagPFRootID) ' entry ID
MsgBox "Public Folders root folder ID = " & strPFRootID
Set objPFRoot = objSession.GetFolder(strPFRootID)
 

See Also

Concepts

InfoStore Object