A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

How to replace getcontactsfolder (ol2007) in Outlook 2003



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old June 12th 09, 04:14 PM posted to microsoft.public.outlook.program_vba
Anthony_fr
external usenet poster
 
Posts: 5
Default How to replace getcontactsfolder (ol2007) in Outlook 2003

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
Ads
  #2  
Old June 12th 09, 06:34 PM posted to microsoft.public.outlook.program_vba
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default How to replace getcontactsfolder (ol2007) in Outlook 2003

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.

--
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


"Anthony_fr" wrote in message
...
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


  #3  
Old June 14th 09, 09:22 PM posted to microsoft.public.outlook.program_vba
Dmitry Streblechenko
external usenet poster
 
Posts: 2,116
Default How to replace getcontactsfolder (ol2007) in Outlook 2003

plug In Redemption RDOAddressList.GetContactsFolder works in any version
of Outlook - http://www.dimastr.com/redemption/rd...ddressList.htm
/plug

--
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
"Anthony_fr" wrote in message
...
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



 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Outlook 2007 and Exchange Server 2003 - No end dates in OL2007 Stephen White Outlook - Calandaring 1 August 11th 08 10:00 PM
find-replace in Outlook contacts? glassofpinot Outlook - Using Contacts 1 April 17th 08 06:43 AM
Search and replace in Outlook fields Anne Outlook - Using Contacts 1 October 5th 07 02:10 PM
Install Outlook 2007 to replace 2003 fjs001 Outlook - Installation 3 September 10th 07 04:03 PM
How can I do a global find & replace in Outlook? JMDouble Outlook - Using Contacts 3 November 1st 06 02:13 PM


All times are GMT +1. The time now is 10:32 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.