Results 1 to 7 of 7
  1. #1
    New Lounger
    Join Date
    Feb 2002
    Posts
    20
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Outlook Contacts in Access (2000)

    I would like to make Outlook Contacts available to an Access application. No problem creating a link to the Contacts folder, but there is no primary key or unique identifier. Does anybody have any suggestions how I can join to this linked table from my application? Thank you.

  2. #2
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Outlook Contacts in Access (2000)

    The outlook personal folders are not relational. They're flat tables, so they don't have unique keys.

    If you created the link, you've already joined the linked table to your application. What is it that you're trying to do with it?
    Charlotte

  3. #3
    New Lounger
    Join Date
    Feb 2002
    Posts
    20
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Outlook Contacts in Access (2000)

    The application is to be used for billing customers for services. Typically I would have a table of customer details and join to it using an ID as the key field to create invoices. But the requirement is to use Outlook contacts as the customer list. The data model currently has an invoice master table which holds invoice id, customer id etc, and an invoice detail table. The only way I can see this working is if I can find a way to uniquely identify the customer. Any suggestions? Thanks.

  4. #4
    New Lounger
    Join Date
    Feb 2002
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Outlook Contacts in Access (2000)

    hi,

    correct me if i'm wrong, but in outlook the contactitems have unique identifier called 'EntryID'.
    It is available when coding the connection and retrieving all the contactitems in a loop.
    Ofcourse u can not use a link to the folder, but it is quite possible to run a procedure at the startup of your Access application to check for new contacts in the folder.

    here is an example;
    The table 'tbl_Contacts' has these fields:
    OtlID (Text - PrimaryKey)
    ContactLastName (text)
    ContactFirstName (text)
    ContactEmail (text)

    Public Sub CheckEntries()
    Dim olApp As Outlook.Application
    Dim olCT As Outlook.ContactItem
    Dim otlNameSpace As Outlook.NameSpace
    Dim otlFld As Outlook.MAPIFolder

    Set olApp = CreateObject("Outlook.Application")
    Set otlNameSpace = Outlook.GetNamespace("MAPI")
    Set otlFld = otlNameSpace.GetDefaultFolder(olFolderContacts)

    For Each olCT In otlFld.Items
    If IsNull(DLookup("OtlID", "tbl_Contacts", "OtlID = " & Chr(34) & olCT.EntryID & Chr(34))) Then
    DoCmd.RunSQL ("Insert into tbl_Contacts (OtlID, ContactLastName, ContactFirstName, ContactEmail) values (" & _
    Chr(34) & olCT.EntryID & Chr(34) & ", " & Chr(34) & olCT.LastName & Chr(34) & _
    ", " & Chr(34) & olCT.FirstName & Chr(34) & ", " & Chr(34) & olCT.Email1Address & Chr(34) & ")")
    End If
    Next olCT

    Set olApp = Nothing

    End Sub


    cheers
    Ricky

  5. #5
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Outlook Contacts in Access (2000)

    It isn't unusual to be given requirements that look quite simple to the client and are not simple in implementation. You may have to revisit that requirement and negotiate with the client. You cannot allow the client to dictate exactly HOW you implement the solution even though they have a right to specify what they want the application to do.

    You will NOT be able to do a direct link between Outlook Contacts and an Access table because any unique identifiers embedded within the Outlook data are not available in the linked Contacts table. You will have to either take Paurths suggestion or come up with something else that accomplishes the same thing. Is the application using the contacts list to email billings, or why are they insisting on using the contacts folder?
    Charlotte

  6. #6
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,623
    Thanks
    3
    Thanked 60 Times in 60 Posts

    Re: Outlook Contacts in Access (2000)

    I agree whole-heartedly. We've tried to do this sort of stuff and it basically gets real ugly real fast. In one case we actually resorted to keeping the entire contact database in Access, and used OLE Automation to populate the Outlook contacts information. All editing had to be done in Access, but you could use Outlook to pull up information and record contact info in the journal. It was a marginal success, as users were never happy that they couldn't edit contact records in Outlook, and some editing functions were a bit pokey because of the automation code. Wish I could be more positive about it, but experience hasn't been so far.
    Wendell

  7. #7
    New Lounger
    Join Date
    Feb 2002
    Posts
    20
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Outlook Contacts in Access (2000)

    Thanks for your help guys.
    I will give Paurths suggestion a try, looks like it will do what is required. And if that is not successful, I will see that the requirement is changed and that the contact table in Access is maintained independently.
    I appreciate your suggestions.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •