Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Modules / DAO / VBA / April 2006

Tip: Looking for answers? Try searching our database.

Accessing contacts in a different folder called "Work Contacts"

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Charlie - 29 Apr 2006 22:57 GMT
Here is the beginning of some code I'm using:
  ' Set up DAO objects (uses existing "Contacts" table)
  Dim rst As DAO.Recordset
  Set rst = CurrentDb.OpenRecordset("Outlook Contacts")

  ' Set up Outlook objects.
  Dim ol As New Outlook.Application
  Dim olns As Outlook.Namespace
  Dim cf As Outlook.MAPIFolder
  Dim c As Outlook.ContactItem
  Dim objItems As Outlook.Items
  Dim Prop As Outlook.UserProperty

  Set olns = ol.GetNamespace("MAPI")
  Set cf = olns.GetDefaultFolder(olFolderContacts)
  Set objItems = cf.Items
  iNumContacts = objItems.Count
  If iNumContacts <> 0 Then
     For I = 1 To iNumContacts
        If TypeName(objItems(I)) = "ContactItem" Then
           Set c = objItems(I)
           If c.Categories = strCategory Then 'It's one of the right category

My question is which part of this do I need to change if I want to access
contacts in a different folder?  In Outlook, I have a folder called Work
Contacts, it's not a sub folder to "Contacts" it's just another folder in the
list where it says Contacts, Inbox, Outbox, etc...  I'd like to access these
contact items directly, rather than having to always move them to my regular
Contact folder to access them.
thanks,
ck
John Nurick - 30 Apr 2006 06:47 GMT
Hi Charlie,

This is an Outlook question rather than an Access one. A good place to
look is www.outlookcode.com 

>Here is the beginning of some code I'm using:
>   ' Set up DAO objects (uses existing "Contacts" table)
[quoted text clipped - 27 lines]
>thanks,
>ck

--
John Nurick [Microsoft Access MVP]

Please respond in the newgroup and not by email.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.