View Single Post
  #4  
Old August 17th 07, 02:58 PM posted to microsoft.public.outlook.program_vba
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default GAL reading and updation of data

There is no AddressEntryFields collection in Redemption. Use
AddressEntry.Fields.

Redemption is different than CDO 1.21, which does have a Fields collection.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"Safal" wrote in message
news
Hi,

I am using the redemption object to connect to the GAL and read each item
with its attributes like Name,Department,telephone etc.

Below is the script I tried -

objAddressEntry.Fields seems to be failing (does not find the
collection) -
Any particular reason ? Where as objAddressEntry.Name seems to work fine
and
returns the name of the group or contact from the GAL.

Also how can I update the GAL ? (as a next step)

Const CdoPR_GIVEN_NAME = &H3A06001F
Const CdoPR_TITLE = &H3A17001E

set Session = CreateObject("Redemption.RDOSession")
Session.Logon
set AddrList = Session.AddressBook.AddressLists.Item("Global Address
List")
MsgBox "There are " & AddrList.AddressEntries.Count & " items in the GAL"

Set objAddressEntries = AddrList.AddressEntries
int i=0

For Each objAddressEntry In objAddressEntries
on error resume next
Set objAddressFields = objAddressEntry.Fields
MsgBox objAddressEntry.Name
If Not objAddressFields is Nothing Then
MsgBox objAddressFields.Item(CdoPR_GIVEN_NAME).Value
MsgBox objAddressFields.Item(CdoPR_TITLE).Value
End If
Next

Regards,
Safal


Ads