GetDefaultFolder question

I want to add contacts from my Access database to an Outlook Contacts folder.  I know how to send the data - but how do I tell the program which of several Contacts folders I want to send the data to.  Is there a GetSpecificFolder type function or similar??
pigglesAsked:
Who is Participating?
 
aIceConnect With a Mentor Commented:
Give the following URL a shot
http://support.microsoft.com/support/kb/articles/q180/6/96.asp

Here is a bit of sample code that may answer you question

Set pubFolder = New Outlook.Application.GetNameSpace("MAPI").Folders("Public Folders")
 
  Set specificFolder = pubFolder.Folders("My Public Contacts")

I hope this helps
 
0
 
BlackManCommented:
I think you have to do something like this: (Not tested, kind of pseudocode)

Set MyContacts = olns.GetDefaultFolder(olContacts)
For I = 0 MyContacts.Count - 1
  Print MyContacts.Items(I)

0
 
pigglesAuthor Commented:
Hi BlackMan - thanks for the reply.  I think you are probably on the right track, but I have tried your pseudocode and several variations on it and I keep getting range errors.
0
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
aIceCommented:
Do you want use a public ora private store?
0
 
pigglesAuthor Commented:
Hi Alce - Thanks for replying. I need to access a folder within "All Public Folders"
0
 
aIceCommented:
BTW I meant to say:
Here is a bit of sample code that may answer "your" question.
Sorry about that
0
 
pigglesAuthor Commented:
Hi Alce thanks for the answer.  I appreciate your help.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.