[AccessD] Checking Outlook Contact Info from Access

John Bartow john at winhaven.net
Fri Aug 3 01:37:02 CDT 2007


I've got routines to pull data into Access from Outlook as I need it when
adding new client's to a db. I also pull in the "EntryID" as its the only
unique property per item I can locate in Contacts.

I'm now attempting to verify and add/update Outlook Contact info from Access
when editing in Access by using EntryID to filter the Outlook Items. Problem
is - and this took me quite awhile to see in the help file for some reason -
"EntryID" can't be used with the Restrict method.

Set oApp = CreateObject("Outlook.Application")
Set oNspc = oApp.GetNamespace("MAPI")
Set oContacts = oNspc.GetDefaultFolder(olFolderContacts).Items
strContactToCheck = "[CustomerID] = """ & strEntryID & """"
Set oItems = oContacts.Restrict(strContactToCheck)

Someone recently asked what the problem with Outlook IDs was. Well here it
is, the one unique ID and it can't be used to filter the Items.

Any ideas on how to lookup a specific contact in Outlook so that it's
properties can be compared to the Access data?





More information about the AccessD mailing list