RDOAddressList object

 

RDOAddressList object represents an Address List with its child address entries and subcontainers.

Returned by:

AddressBook.DefaultAddressList, PAB, GAL, GetAddressListFromID

RDOAddressBookSearchPath.Item

RDOAddressLists.GetFirst, GetLast, GetNext, GetPrevious, Item

 

The example below logs to the default MAPI session and displays the number of address entries in GAL (Exchange only):

set Session = CreateObject("Redemption.RDOSession")
Session.Logon
set GAL = Session.AddressBook.GAL

MsgBox GAL.AddressEntries.Count


Derived from: _MAPIProp -


_MAPIProp methods and properties: GetIDsFromNames, Fields(), GetPropList, GetNamesFromIDs, CopyTo, Save, MAPIOBJECT, Session

 


Properties


EntryID

string, read-only. Hex representation of the address list entry id.

 

AddressEntries

Returns RDOAddressEntries collection representing the child address entries

 

see example above

AddressLists

Returns RDOAddressLists collection representing the child address lists

 

 
AddressListType
rdoAddressListType enum, read-only. Represents the type of the address list.

olExchangeGlobalAddressList = 0
olExchangeContainer = 1
olOutlookAddressList = 2
olOutlookLdapAddressList = 3
olCustomAddressList = 4

 

Default

Boolean, read-write. Determines whether the address list is displayed first when the address book window opens.

 

 

Name

String, read-write. The name of the address list

 

 

IsReadOnly

Boolean, read-only. Determines whether the address list is modifiable.

 

 
Search RDOAddressListSearch, read-only.
This object
allows to set search criteria on a particular address list (represented by the RDOAddressList object).
WARNING
: among standard Outlook Address book providers, only the Exchange Address Book provider supports this feature.
set Session = CreateObject("Redemption.RDOSession")
Session.MAPIOBJECT = Application.Session.MAPIOBJECT
set AddrList = Session.Addressbook.GAL
set Search = AddrList.Search
Search.FirstName = "John"
Search.City = "Phoenix"

set AddressEntries = Search.GetResults
for each AddressEntry in AddressEntries
    Debug.Print AddressEntry.Name
next

Methods


GetContactsFolder

Returns RDOFolder object corresponding to the given address list.

This method is only available for the address lists returned by the Outlook Address Book (OAB) provider that uses "IPM.Contact" messages (corresponding to the RDOContactItem object) as its storage. Other providers (e.g. GAL) will return NULL from this method.

 

This method is the counterpart of the RDOFolder2.GetAddressList method.

set Session = CreateObject("Redemption.RDOSession")
Session.MAPIOBJECT = Application.Session.MAPIOBJECT
set AddrList = Session.AddressBook.AddressLists.Item("Contacts")
if not (AddrList is Nothing) Then
  set Folder = AddrList.GetContactsFolder
  if not (Folder is Nothing) Then
    MsgBox "Contacts folder contains " & Folder.Items.Count & _
    " entries, the corresponding OAB container contains " & _
    AddrList.AddressEntries.Count & " entries"
  End If
End If

 

ResolveName(Name)

Resolves a given name against the address list. Returns AddressEntry object

 

set Session = CreateObject("Redemption.RDOSession")
Session.MAPIOBJECT = Application.Session.MAPIOBJECT
set Contacts = Session.AddressBook.AddressLists.Item("Contacts")
set AdrrEntry = Contacts.ResolveName("dmitry")

MsgBox AdrrEntry.Address

 

ResolveNameEx(Name)

Resolves the given name against the address list and returns a list of matches in the RDOAddressEntries object.

 

ResolveNameEx applies PR_ANR restriction .to the container contents table and returns the restricted collection of the list entries.

 

Name - string. The name to be resolved.

 

set Session = CreateObject("Redemption.RDOSession")
Session.Logon
set AdrrEntries = Session.AddressBook.GAL.ResolveNameEx("John")
Debug.Print AdrrEntries.Count & " names were returned by ResolveNameEx:"
Debug.Print "------------"
for each AE in AdrrEntries
    Debug.Print AE.Name
next
Debug.Print "------------"