Results 1 to 7 of 7
  1. #1
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    San Francisco, California, USA
    Posts
    358
    Thanks
    0
    Thanked 0 Times in 0 Posts

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

    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!!!

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Global Address List (Outlook/Exchange) in Access (2002)

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

  3. #3
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Global Address List (Outlook/Exchange) in Access (2002)

    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).

  4. #4
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    San Francisco, California, USA
    Posts
    358
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Global Address List (Outlook/Exchange) in Access (2002)

    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

  5. #5
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    San Francisco, California, USA
    Posts
    358
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Global Address List (Outlook/Exchange) in Access (2002)

    (Edited by HansV to make URL clickable - see <!help=19>Help 19<!/help>)

    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

    Thanks anyway!

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Global Address List (Outlook/Exchange) in Access (2002)

    Thanks for the reference to the article on the OutlookCode site. Unfortunately for you, it confirms that not all fields are included. <img src=/S/sad.gif border=0 alt=sad width=15 height=15>

  7. #7
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    San Francisco, California, USA
    Posts
    358
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Global Address List (Outlook/Exchange) in Access (2002)

    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.

Posting Permissions

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