Class AddressLists (Outlook VBA)
Contains a set of AddressList objects. To use a AddressLists class variable it first needs to be instantiated, for example
Dim als as AddressLists
Set als = Session.AddressLists
For Each
Here is an example of processing the AddressLists items in a collection.
Dim alt As AddressList
For Each alt In AddressLists
Next alt
Class
Returns an OlObjectClass constant indicating the object's class. Here you can find possible values for
Dim oocsClass As OlObjectClass
oocsClass = Session.AddressLists.Class
Count
Returns a Long indicating the count of objects in the specified collection.
Dim lngCount As Long
lngCount = Session.AddressLists.Count
Item
Returns an AddressList object from the collection.
Item (Index)
Index: Either the index number of the object, or a value used to match the default property of an object in the collection.
Dim alt As AddressList
Set alt = Session.AddressLists(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 do the same function: