How to replace getcontactsfolder (ol2007) in Outlook 2003

  • Thread starter Anthony_fr
  • Start date Views 1,357
Status
Not open for further replies.
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.

"Anthony_fr" <Anthonyfr> wrote in message

news:5B91A6C5-73B4-44B2-9B25-FD89324C2236@microsoft.com...
> 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
 
D

Dmitry Streblechenko

<plug> In Redemption RDOAddressList.GetContactsFolder works in any version

of Outlook - http://www.dimastr.com/redemption/rdo/RDOAddressList.htm

</plug

Dmitry Streblechenko (MVP)

-

"Anthony_fr" <Anthonyfr> wrote in message

news:5B91A6C5-73B4-44B2-9B25-FD89324C2236@microsoft.com...
> 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
 
Status
Not open for further replies.
Top