Index Property (InfoStore Object)

Index Property (InfoStore Object)

The Index property returns the index number for the InfoStore object within the parent InfoStores collection. Read-only.

Syntax

objInfoStore.Index

Data Type

Long

Remarks

The Index property indicates this objects position within the parent InfoStores collection. It can be saved and used later with the collections Item property to reselect the same message store in the collection.

The first object in the collection has an Index value of 1.

Example

Function InfoStoresGetByIndex()
Dim lIndex As Long
Dim objOneInfoStore As InfoStore ' assume valid InfoStore
    ' set error handler here
    If objInfoStoreColl Is Nothing Then
        MsgBox "Must select an InfoStores collection"
        Exit Function
    End If
    If 0 = objInfoStoreColl.Count Then
        MsgBox "must select collection with 1 or more InfoStores"
        Exit Function
    End If
    ' prompt user for index; for now, use 1
    Set objOneInfoStore = objInfoStoreColl.Item(1)
    MsgBox "Selected InfoStore 1: " & objOneInfoStore.Name
    lIndex = objOneInfoStore.Index ' save index to retrieve this later
    ' ... get same InfoStore object later
    Set objOneInfoStore = objInfoStoreColl.Item(lIndex)
    If objOneInfoStore Is Nothing Then
        MsgBox "Error, could not reselect the InfoStore"
    Else
        MsgBox "Reselected InfoStore " & lIndex & _
            " using index: " & objOneInfoStore.Name
    End If
    Exit Function
 

See Also

Concepts

InfoStore Object