accessing Outlook 2003 contacts in VBA

dunccr

New member
Local time
Today, 08:39
Joined
Nov 26, 2007
Messages
2
Can anyone provide the VBA code required to access contacts held in Outlook 2003 .
Many Thanks
 
Actually, you don't really need to use VBA.

You can just link it. In database windows, select File-> Get External Data -> Link Table then in the dialog select Exchange as file type and you should be able to get contact info that way.
 
Thanks that certainly works but am accessing an SQL table (Goldmine) to extract contact details into a Sales Forecasting appl in VBA. I want to extract the access to the Goldmine table and insert access to a contact folder in Outlook. The access to the Goldmine table is :
Private Sub CustomerName_AfterUpdate()
Dim cnn As New ADODB.Connection
Dim rs As New ADODB.Recordset
Set cnn = CurrentProject.Connection
rs.Open "select address1, address2, key4, contact, city from dbo_CONTACT1 where accountno='" & Me!Customername & "'", cnn, adOpenDynamic, adLockOptimistic
Me!Address1 = rs!Address1
Me!Address2 = rs!Address2
Me!SalesPerson = rs!key4
Me!Contact = rs!Contact
Me!City = rs!City
rs.Close
End Sub

I would like to know what code I need to access an Outlook 2003address book
 
Okay, I'm a bit confused.

Do you want to move data from Goldmine to Outlook Contact? If so, you use an append query against the linked table.

Do you want to display data on a form (it looks like you're coding for a form event...)? If so, you just create a query that uses the linked table (for either Goldmine or Outlook) as a recordsource.

Neither requires VBA, or maybe you want your users to read data from Goldmine and decide for themselves if they want to add to Outlook contact, in which case, you make form's recordsource bound to the Goldmine, then create a button (or whatever you like) to execute a single-row append query to add the contact.
 

Users who are viewing this thread

Back
Top Bottom