How to replace getcontactsfolder (ol2007) in Outlook 2003

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
 
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
 
<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.
Similar threads
Thread starter Title Forum Replies Date
O Replace hard returns with soft returns on selected text and button to QAT Using Outlook 5
Beeto Replace a string in body Outlook VBA and Custom Forms 2
O How to find and replace a word in Outlook-Agenda-Subject and Message? Using Outlook 0
S HTML Code Embedded in String Within Open Outlook Email Preventing Replace(Application.ActiveInspector.CurrentItem.HTMLBody From Working Outlook VBA and Custom Forms 4
M Outlook 2013 Replace Subject with Conversation (a "hidden" value). Outlook VBA and Custom Forms 0
F Copy and replace not update contact in another pst Using Outlook 0
B Automatically Forward Emails and Remove/Replace All or Part of Body Outlook VBA and Custom Forms 8
C How to replace or delete first instance of sentence in mail body? Outlook VBA and Custom Forms 1
C replace subject line generated by converting a word document to PDF and sending it to an email Using Outlook 8
Diane Poremsky How to perform a global search and replace Using Outlook 0
B Delete/replace old files and save new attachments Using Outlook 1
Diane Poremsky Replace Display Names with Email Addresses Using Outlook 0
mrje1 Is there a Find and Replace feature in Outlook 2016? Using Outlook 4
J Pull an email address from body and replace reply-to address Outlook VBA and Custom Forms 4
divan Outlook 2007 - Replace email body with custom text Using Outlook 9
E VBScript to replace module? Using Outlook 3
A How to replace column title in address book Using Outlook 1
V Replace only part of subject in OUTLOOK 2003 Outlook VBA and Custom Forms 1
A Replace olFolderContacts for Sharepoint lists in Outlook Outlook VBA and Custom Forms 5
P replace default outlook form with custom form Outlook VBA and Custom Forms 1
J Does the .fdm contain my custom form? How to make ol use it? - ol2007 Outlook VBA and Custom Forms 4
E OL2007 on Exchange: opening OL on different computers Using Outlook 1
Z OL2007 - is there a way to disable the "feature" that cripples mails that are in the "junk" folder? Using Outlook 37
R Multiple instances of OL2007 and creating rules Exchange Server Administration 1
P OL2007 -- All day appt. end time is "tomorrow" Using Outlook 3
T Search for multiple contacts in OL2007 Using Outlook 3
M Develop for OL2003 on OL2007 machine using VS2008 and VSTO? Outlook VBA and Custom Forms 1
M OL2007 Add-in won't install on OL2010 Outlook VBA and Custom Forms 1
P Embed Word doc w/form into OL2007 form Outlook VBA and Custom Forms 1
N Right-click an address -&gt; add to BCM? [OL2007] BCM (Business Contact Manager) 1
J Deploying OL2007 Add-In Outlook VBA and Custom Forms 3
P Redemption not working on OL2007 Outlook VBA and Custom Forms 2

Similar threads

Back
Top