Class Stores (Outlook VBA)

A set of Store objects representing all the stores available in the current profile. To use a Stores class variable it first needs to be instantiated, for example


Dim strs as Stores
Set strs = Session.Stores

For Each

Here is an example of processing the Stores items in a collection.


Dim str As Store
For Each str In Stores
	
Next str

Class

Returns an OlObjectClass constant indicating the object's class. Here you can find possible values for OlObjectClass.


Dim oocsClass As OlObjectClass
oocsClass = Session.Stores.Class

Count

Returns a Long indicating the count of objects in the specified collection.


Dim lngCount As Long
lngCount = Session.Stores.Count

Item

Returns a Store object that is specified by Index.

The Store.DisplayName property is the default property of a Store. If Index is a string and no item can be found by that name, an error will be returned.

Item (Index)

Index: Either an Integer that specifies a one-based index into the Stores collection, or a String value that specifies the DisplayName of a Store in the Stores collection.


Dim str As Store
Set str = Session.Stores(Index:=1)

Session

Returns the NameSpace object for the current session.

The Session property and the GetNamespace method can be used interchangeably to obtain the NameSpace object for the current session. Both members serve the same purpose. For example, the following statements perform the same function: