How to replace getcontactsfolder (ol2007) in Outlook 2003

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
 
K

Ken Slovak - [MVP - Outlook]

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top