[AccessD] Export Outlook Global Address List

Mike & Doris Manning mikedorism at verizon.net
Mon Nov 7 09:15:17 CST 2005


I don't have code for how to export it from Outlook but I do have code for
how to import it from within Access.  My code uses Redemption to get around
the security issues but the normal Outlook process should be identical.

Doris Manning
mikedorism at verizon.net

**************************************************************

Public Function SafeAddress(MyForm As String)
    On Error GoTo ErrorHandler
    
    Dim oSafeAddr As Object
    Dim oAddrEntries As AddressEntries
    Dim oAddrEntry As AddressEntry
    Dim FormName As Form
    Dim strDispName As String
    Dim strMailName As String
    
    Const GivenName = &H3A06001E
    Const Surname = &H3A11001E
    
    Set FormName = Forms(MyForm)
    Set oSafeAddr = CreateObject("Redemption.AddressLists")
    Set oAddrEntries = oSafeAddr("Global Address List").AddressEntries
    
    For Each oAddrEntry In oAddrEntries
        If Not IsEmpty(oAddrEntry.Fields(GivenName)) And _
        Not IsEmpty(oAddrEntry.Fields(Surname)) Then
            strDispName = oAddrEntry.Name
            strMailName = oAddrEntry.Fields(GivenName) &
oAddrEntry.Fields(Surname)
            strMailName = strMailName & "@hargroveinc.com"
            FormName!lstOthers.AddItem strDispName & ";" & strMailName
        End If
    Next oAddrEntry
    
    Set oAddrEntry = Nothing
    Set oAddrEntries = Nothing
    Set oSafeAddr = Nothing
    Set FormName = Nothing
    
    Exit Function
    
ErrorHandler:
    Call HandleErrors(Err, strMyName, "SafeAddress")
    
End Function





More information about the AccessD mailing list