• Global Address List (Outlook/Exchange) in Access (2002)

    Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » Global Address List (Outlook/Exchange) in Access (2002)

    Author
    Topic
    #444758

    Greetings all,

    I am trying to find the most simple way to access the Global Address List in Outlook from Access. I’m trying to avoid importing and exporting and therefore having to maintain a separate database.

    I tried linking the Exchange table directly into Access which would be the ideal solution, but somehow when you do that, you lose some properties, for example I lose the Room Number, which is the #1 piece of information I want (because people are too lazy to look it up in outlook lolololol). Apparently this is what Microsoft wants. Unfortunately, it’s not what I need.

    Has anyone tried doing this? Any suggestions?

    TIA!!!

    Viewing 0 reply threads
    Author
    Replies
    • #1076443

      I don’t know of any other way to link Exchange data in Access than through File | Get External Data | Link…

      • #1076455

        Okay….do you know if there is any way I can get the other properties from Exchange? Then I could build a table and have it synch on a regular basis. I suppose that’s better than nothing….

        Here is some code for contacts that is in the MSKB, but I can’t figure out the magic code to change it to the global address list. I get an error every time.

        Sub ImportContactsFromOutlook()

        ‘ This code is based in Microsoft Access.

        ‘ Set up DAO objects (uses existing “tblContacts” table)
        Dim rst As DAO.Recordset
        Set rst = CurrentDb.OpenRecordset(“tblContacts”)

        ‘ Set up Outlook objects.
        Dim ol As New Outlook.Application
        Dim olns As Outlook.Namespace
        Dim cf As Outlook.MAPIFolder
        Dim c As Outlook.ContactItem
        Dim objItems As Outlook.Items
        Dim Prop As Outlook.UserProperty

        Set olns = ol.GetNamespace(“MAPI”)
        Set cf = olns.GetDefaultFolder(olFolderContacts)
        Set objItems = cf.Items
        iNumContacts = objItems.Count
        If iNumContacts 0 Then
        For i = 1 To iNumContacts
        If TypeName(objItems(i)) = “ContactItem” Then
        Set c = objItems(i)
        rst.AddNew
        rst!FirstName = c.FirstName
        rst!LastName = c.LastName
        rst!Address = c.BusinessAddressStreet
        rst!City = c.BusinessAddressCity
        rst!State = c.BusinessAddressState
        rst!Zip_Code = c.BusinessAddressPostalCode
        ‘ Custom Outlook properties would look like this:
        ‘ rst!AccessFieldName = c.UserProperties(“OutlookPropertyName”)
        rst.Update
        End If
        Next i
        rst.Close
        MsgBox “Finished.”
        Else
        MsgBox “No contacts to export.”
        End If

        End Sub

        • #1076457

          I’ve never used another method. Frankly, I’m amazed that not all fields come over into Access. But I cannot test anything at the moment (I’m at home, with only stand-alone Outlook).

          • #1076459

            (Edited by HansV to make URL clickable – see Help 19)

            Well, that is what is happening to me. After much searching, this article confirms what was going on: http://www.outlookcode.com/article.aspx?ID=25%5B/url%5D

            Thanks anyway!

            • #1076462

              Thanks for the reference to the article on the OutlookCode site. Unfortunately for you, it confirms that not all fields are included. sad

            • #1076463

              Yes, but it also says that you can write code using ADO or DAO to get the custom properties out of it.

              I’m just desperately trying to come up with the right code, but nothing is working.

              If I find a solution, I’ll share it. I’m still working on it.

    Viewing 0 reply threads
    Reply To: Global Address List (Outlook/Exchange) in Access (2002)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: