In order to run the code below, a reference must be set to the ConstitDataUI.dll file.  This can be found in "C:\Program Files\Blackbaud\The Raisers Edge 7\PIA".
*** In RE 7.91 you will need to look in the C:\Program Files\Blackbaud\The Raisers Edge 7\DLL folder for the ConstitData7.dll file. 


Private Sub AddressCopyQuick()
   
    Dim oH As CConstitUIHelper
    Set oH = New CConstitUIHelper
    oH.Init REApplication.SessionContext

    Dim oHelper As IBBConstitUIHelper
    Set oHelper = oH
   
    oHelper.Init REApplication.SessionContext

    Dim oRec As CRecord
    Set oRec = New CRecord
   
    oRec.Init REApplication.SessionContext
    oRec.Load 280
   
    Dim oRec2 As CRecord
    Set oRec2 = New CRecord
   
    oRec2.Init REApplication.SessionContext
    oRec2.Load 751
   
    Dim oAddr As CConstitAddress
 
    For Each oAddr In oRec.Addresses
        If oAddr.Fields(CONSTIT_ADDRESS_fld_STATE) = "GA" Then
            oHelper.CopyAddress oAddr, oRec2.Addresses.Add
        Else: End If
    Next oAddr
       
 
    oHelper.Closedown
    Set oHelper = Nothing
 
    oH.Closedown
    Set oH = Nothing
   
    oRec.Closedown
    Set oRec = Nothing
   
    oRec2.Save
   
    oRec2.Closedown
    Set oRec2 = 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.