import custom fields from outlook to access

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a form set with custom fields for contacts is there any way I can
import them into access and is it possilbe to link the data

Graeme
 
Access can LINK to an outlook contacts (file?)

Tables
New
Link
down at the bottom of the window look for exchange() and or
Outlook
select the table - Contacts

Now whether it can see custom fields, If you see them they are right
there and as such do not need to be "imported" but simply linked if you
have what is needed to link them. If they are NOT there, someone else
will need to jump in if there is another way of looking at the Outlook
information.
 
Ron2006 said:
Access can LINK to an outlook contacts (file?)

Tables
New
Link
down at the bottom of the window look for exchange() and or
Outlook
select the table - Contacts

Now whether it can see custom fields, If you see them they are right
there and as such do not need to be "imported" but simply linked if
you have what is needed to link them. If they are NOT there, someone
else will need to jump in if there is another way of looking at the
Outlook information.

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 automation
code though.

Below is a snippet from one of my routines where I am looking at a public
contacts folder on our network. Within the For-Each loop you can see where
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 user-defined
field named "FAX" (the last one) and to access that I use the syntax...

..UserProperties("FAX")

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 Cancelled"
Else
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) & " " &
Trim(Me.VMRZIP)
.BusinessTelephoneNumber = Trim(Me.[VMTEL_])
.UserProperties("FAX") = Trim(Me.VMFAX_)
.Save
End With
Next objContact
End If
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top