AddressLists Property
Returns an AddressLists collection representing a collection of the address lists available for this session. The AddressLists collection represents the root of the address book hierarchy for the current session. A particular AddressList object represents one of the available address books. The type of access you obtain depends on the access permissions granted to you by each individual address book provider.
expression.AddressLists
expression Required. An expression that returns a NameSpace object.
Example
This Visual Basic for Applications example uses the Add method to add a new AddressEntry to the Personal Address Book. The Name, "John Q. Public" is necessary to avoid errors.
If this entry already exists, the code skips to DialogBox:
.
The Details method displays a dialog box
that shows the information for this entry.
Set myOlApp = CreateObject("Outlook.Application")
Set myNamespace = myOlApp.GetNamespace("MAPI")
Set myAddrList = myNamespace.AddressLists("Personal Address Book")
Set myAddrEntries = myAddrList.AddressEntries
Set myEntry = myAddrEntries.Add("Microsoft Mail Address")
myEntry.Name = "John Q. Public"
On Error GoTo DialogBox
myEntry.Address = "[email protected]"
myEntry.Update
DialogBox:
myEntry.Details