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??
Who is Participating?
aIceConnect With a Mentor Commented:
Give the following URL a shot

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

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.
Free tool for managing users' photos in Office 365

Easily upload multiple users’ photos to Office 365. Manage them with an intuitive GUI and use handy built-in cropping and resizing options. Link photos with users based on Azure AD attributes. Free tool!

Do you want use a public ora private store?
pigglesAuthor Commented:
Hi Alce - Thanks for replying. I need to access a folder within "All Public Folders"
BTW I meant to say:
Here is a bit of sample code that may answer "your" question.
Sorry about that
pigglesAuthor Commented:
Hi Alce thanks for the answer.  I appreciate your help.
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.