How to replace getcontactsfolder (ol2007) in Outlook 2003

  • Thread starter Thread starter Anthony_fr
  • Start date Start date
A

Anthony_fr

Hi,

I use the getcontactsfolder in my code. but it don't work in ol2003

How I can replace it ?

' Create an Outlook application.
Dim oApp 'As Outlook.Application
Set oApp = CreateObject("Outlook.Application")

' Get the MAPI namespace.
Dim oNS 'As Outlook.NameSpace
Set oNS = oApp.Session

' Get the AddressLists collection.
Dim oALs 'As Outlook.AddressLists
Set oALs = oNS.AddressLists

' Loop through the AddressLists collection.
Dim i 'As Integer

Dim reponse
Dim oAL 'As Outlook.AddressList
Dim oAF


For i = 1 To oALs.Count
Set oAL = oALs.Item(i)
' oAl.GetContactsFolder is not available in ol2003
Set oAF = oAL.GetContactsFolder
oAF.ShowAsOutlookAB=False
Next

Thanks for your help
 
You have to use hacks such as getting a few AddressEntry objects from that
list and iterating all the contacts folders until you find one that has
those AddressEntry objects as matching ContactItem objects.
 
Back
Top