Public Sub LoopAttributes()

Dim oSt As cSBStudent
Set oSt = New cSBStudent
oSt.Init fe_application.SessionContext

'load specific account
oSt.Load 2

Dim oAttribute As IBBAttribute

Dim feservice As FE_Services
Set feservice = New FE_Services
feservice.Init fe_application.SessionContext

Dim oAtTypServer As CAttributeTypeServer
Set oAtTypServer = feservice.CreateServiceObject(bbsoAttributeTypeServer)
'bbGlobalAttributeType_GLAccount to specify what type of attribute you are looking for
oAtTypServer.Init fe_application.SessionContext, bbGlobalAttributeType_SBStudent

Dim lAttributeID As Long
Dim sDescription As String

For Each oAttribute In oSt.Attributes
  'Find the id of the Description of the attribute
  lAttributeID = oAttribute.Fields(Attribute_fld_ATTRIBUTETYPESID)
  'Find the string valuse of the attribute
  sDescription = oAtTypServer.GetAttributeTypeDescription(lAttributeID)
 
  Debug.Print sDescription
  Debug.Print oAttribute.Fields(Attribute_fld_VALUE)

 
Next oAttribute

feservice.CloseDown
Set feservice = Nothing

oSt.CloseDown
Set oSt = Nothing

End Sub

Disclaimer: We provide 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 you are familiar with Microsoft Visual Basic and the tools used to create and debug procedures. Blackbaud Customer Support may help explain the functionality of a particular procedure, but we will not modify, or assist you with modifying, these examples to provide additional functionality.