By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,870 Members | 2,347 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,870 IT Pros & Developers. It's quick & easy.

Access and Outlook

P: n/a

I am trying to start a database that uses contact details from my Outlook
contacts information. Can anyone suggest how to look up all records in the
Outlook contacts and make a table in access with them that includes an
individual reference and then regularly look up new entries in the Outlook
contacts and add these records to the table.

Any help would be greatly appreciated.
May 31 '06 #1
Share this Question
Share on Google+
4 Replies

P: n/a
Just so you know: You can link directly to data in Exchange by using File |
Get Data | Link Tables...

In the dialog box that opens, open the "Files of Type" dropdown and select

If you're goin through Exchange, that might suggest some possibilities.

If you're on a local machine, you can get to your own Outlook stores by
going into a module, using Tools | References, and checking the box next to
Microsoft Outlook x.x Object Library. This gives you a way to get to that
data. You'd have to write code to do the kinds of correspondence checking
you refer to.

Take a look at one of these for a start.

For your local stores, this should give you some food for thought:
May 31 '06 #2

P: n/a
If you link it, you have it and you don't have to make another table.

Jun 1 '06 #3

P: n/a
This would link the table fine, but my problem is that there would be no
unique identifier, hence why I need a primary key or something similar.
There may be seven John Smiths in the table and if I wish to attach a piece
of a data to one of them I cannot differentiate.

"Ron2006" <ro******> wrote in message
If you link it, you have it and you don't have to make another table.

Jun 5 '06 #4

P: n/a
Given that constraint I found this from another post about Accessing
Outlook via Automation to get all fields:
This may give you what you need.
You normally don't even get all of the built in fields when linking to
Outlook much less the user defined ones. They can be gotten via
code though.

Below is a snippet from one of my routines where I am looking at a
contacts folder on our network. Within the For-Each loop you can see
I am looking at individual properties of each Contact object. The
built in
ones can be referenced directly, but if you notice we have one
field named "FAX" (the last one) and to access that I use the syntax...

That same syntax would be used for all user defined fields.
***Start Snippet ****
Dim LoopCnt As Integer
Dim gobjOutlook As Object
Dim gobjNameSpace As Object
Dim objContactFolder As Object
Dim objContact As Object
Dim AddEdit As String
Dim SuffixVar As String
Dim ObjContactItems As Object
Dim MyContactSearchItems As Object
'See if we have a Vendor Record Present. If not, cancel
If Len(Nz(Me.VMVN, "")) = 0 Then
MsgBox "No Vendor Information.", vbExclamation, "Operation
Set gobjOutlook = CreateObject("Outlook.Application")
Set gobjNameSpace = gobjOutlook.GetNamespace("MAPI")
Set objContactFolder = GetFolder("Public Folders\All Public
Folders\Purchasing\Supplier Contacts")
Set ObjContactItems = objContactFolder.Items
Set MyContactSearchItems = ObjContactItems.Restrict("[CustomerID] =
'" &
Trim(Me.VMVN) & "'")
For Each objContact In MyContactSearchItems
With objContact
.CompanyName = Trim(Me.VMNAME)
.CustomerID = Trim(Me.VMVN)
.User4 = Trim(Me.VMVN)
.BusinessAddress = Trim(Me.VMAD1) & vbCrLf & Trim(Me.VMAD2)
vbCrLf & _
Trim(Me.VMCITY) & ", " & Trim(Me.VMST) &
" "
& Trim(Me.VMZIP)
.OtherAddress = Trim(Me.VMRAD1) & vbCrLf & Trim(Me.VMRAD2)
vbCrLf & _
Trim(Me.VMRCTY) & ", " & Trim(Me.VMRST) & "
" &
.BusinessTelephoneNumber = Trim(Me.[VMTEL_])
.UserProperties("FAX") = Trim(Me.VMFAX_)
End With
Next objContact
End If
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com

Jun 5 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.