Public Sub SolEmail()
    Dim oGift As CGift
    Set oGift = New CGift
    oGift.Init REApplication.SessionContext
    oGift.Load 2181
   
    Dim oConst As CRecord
    Set oConst = New CRecord
   
    Dim oAddr As CConstitAddress
    Dim oEmail As CConstitAddressPhone
   
    Dim oSol As IBBRecordSolicitor
   
    For Each oSol In oGift.Solicitors
   
        oConst.Init REApplication.SessionContext
        oConst.Load oSol.Fields(RECORDSOLICITOR_fld_SolicitorId)
        Debug.Print oConst.Fields(RECORDS_fld_FULL_NAME)
       
        For Each oAddr In oConst.Addresses
       
            For Each oEmail In oAddr.Phones
           
                If oEmail.Fields(CONSTIT_ADDRESS_PHONES_fld_PHONETYPE) = "Email" Then
                    Debug.Print oEmail.Fields(CONSTIT_ADDRESS_PHONES_fld_NUM)
                End If
           
                Set oEmail = Nothing
            Next oEmail
       
            Set oAddr = Nothing
        Next oAddr
       

        oConst.Closedown
        Set oConst = Nothing
   
        Set oSol = Nothing
    Next oSol
   
    oGift.Closedown
    Set oGift = Nothing

End Sub

 

Blackbaud provides programming examples for illustration only, without warranty either expressed or implied, including, but not limited to, the implied warranties of merchantability and/or fitness for a particular purpose. This article assumes that you are familiar with Microsoft Visual Basic and the tools used to create and debug procedures.  Blackbaud Customer Support can help explain the functionality of a particular procedure but they will not modify, or assist you with modifying, these examples to provide additional functionality.  If you are interested in learning more about VBA and API modules, contact our Sales department at solutions@blackbaud.com.