_Items.SetColumns Method

Caches certain properties for extremely fast access to those particular properties of an item within the collection.

Namespace:  Microsoft.Office.Interop.Outlook
Assembly:  Microsoft.Office.Interop.Outlook (in Microsoft.Office.Interop.Outlook.dll)

Syntax

'Declaration
<DispIdAttribute()> _
Sub SetColumns ( _
    Columns As String _
)
'Usage
Dim instance As _Items
Dim Columns As String

instance.SetColumns(Columns)
[DispIdAttribute()]
void SetColumns(
    string Columns
)

Parameters

  • Columns
    Type: System.String

    A string that contains the names of the properties to cache. The property names are delimited by commas in this string.

Remarks

The SetColumns method is useful for iterating through the Items collection. If you don't use this method, Microsoft Outlook must open each item to access the property. With the SetColumns method, Outlook only checks the properties that you have cached, and provides fast, read-only access to these properties.

After applying the SetColumns method on specific properties of the collection, you cannot read other properties of that collection; properties which are not cached are returned empty. You cannot write to any of the properties of that collection either. Alternatively, if you require read-write, fast access to a set of items, use the Table object.

SetColumns cannot be used, and will cause an error, with any property that returns an object. It cannot be used with the following properties:

AutoResolvedWinner

InternetCodePage

Body

MeetingWorkspaceURL

BodyFormat

MemberCount

Categories

ReceivedByEntryID

Children

ReceivedOnBehalfOfEntryID

Class

RecurrenceState

Companies

ReplyRecipients

DLName

ResponseState

DownloadState

Saved

EntryID

Sent

HTMLBody

Submitted

IsConflict

VotingOptions

The ConversationIndex property cannot be cached using the SetColumns method. However, this property will not result in an error like the other properties listed above.

See Also

Reference

_Items Interface

_Items Members

Microsoft.Office.Interop.Outlook Namespace

Other Resources

How to: Use SetColumns to Efficiently Enumerate Items in a Folder