james_IT
01-29-2007, 04:30 AM
Hi all,
ive searched the forums but cannot find exactly what im looking for.
ive got an access db of contacts names/emails. how can i get these contacts into my ms outlook address book/contacts list?
any help would be greatly appreciated.
thanks, James
Moniker
01-29-2007, 08:24 AM
You'll need a reference to the MS Outlook Object Library (called "Microsoft Outlook X.0 Object Library" from references in the VBA editor window). From there, you need to investigate the AddressEntries collection and the AddressEntry Object. This is a little bit pseudo-coded, but it will look something like this:
Dim OLApp As New Outlook.Application
Dim OLAddBk As Outlook.AddressEntries
Dim OLAddEntry As Outlook.AddressEntry
Set OLAddBk = OLApp.CreateItem(olContactItem)
Look up MS Access Help on the AddressEntries collection and the AddressEntry object for help on how to add new contacts, etc. Note that you should probably set your security to low (in Access 2003). Otherwise, you'll get warnings like, "This program is attempting to connect to your address book" and so on.
GaryPanic
01-29-2007, 08:51 AM
You could also try
entering in 1 record into your outlook - export this into xls
then do a qry to match - not the tidest way of doing it but if its a one export of data - will work
g.