Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!

import custom fields from outlook to access

Discussion in 'Information Technology' started by Graeme, Jul 28, 2006.

  1. Graeme

    Graeme
    Expand Collapse
    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
     
  2. Loading...

    Similar Threads Forum Date
    Importance Of Dastar History of Sikhism Aug 12, 2016
    Importance Of Tirath / Pilgrimage As Per Gurbani Gurmat Vichaar Jun 1, 2016
    Superheroes: Arjan Bhullar Explains Wrestling's Importance In The Sikh Community Sports & Fitness Apr 15, 2016
    Important decisions in life Questions and Answers May 25, 2015
    Friendship Between Genders... Important Question Questions and Answers Dec 20, 2012

  3. Ron2006

    Ron2006
    Expand Collapse
    Guest

    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.
     
  4. Rick Brandt

    Rick Brandt
    Expand Collapse
    Guest

    Ron2006 wrote:
    > 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


    --
    Rick Brandt, Microsoft Access MVP
    Email (as appropriate) to...
    RBrandt at Hunter dot com
     

Share This Page