The CDO Library lets you change existing address entries in any address book container for which you have modification permission. Typically you have such permission only for your personal address book (PAB).
The following sample code demonstrates this procedure:
' Function: AddressEntry_Update
' Purpose: Demonstrate the Update method
' See documentation topic: Update method AddressEntry object
Function AddressEntry_Update()
Dim objRecipColl As Recipients ' Recipients collection
Dim objNewRecip As Recipient ' New recipient object
On Error GoTo error_olemsg
If objSession Is Nothing Then
MsgBox "must log on first"
Exit Function
End If
Set objRecipColl = objSession.AddressBook ' let user select
If objRecipColl Is Nothing Then
MsgBox "must select someone from the address book"
Exit Function
End If
Set objNewRecip = objRecipColl.Item(1)
With objNewRecip.AddressEntry
.Name = .Name & " the Magnificent"
.Type = "X.500" ' you can update the type, too ...
.Update
End With
MsgBox "Updated address entry name: " & objNewRecip.AddressEntry.Name
Exit Function
error_olemsg:
MsgBox "Error " & Str(Err) & ": " & Error$(Err)
Resume Next
End Function
Using Addresses, Creating a New Address Book Entry, Selecting Recipients from the Address Book