Implements IBBMacroProperties

'--DECLARATIONS BEGIN--------------------------------------
Private WithEvents AFNApplication As AFNApplicationMT 'Provides access to the SessionContext
'--DECLARATIONS END--------------------------------------

'--STANDARD CONNECTION CODE BEGIN-------------------------------
Private Sub GetAFNObjects(Application As AFNApplicationMT)
   Set AFNApplication = Application
End Sub

Private Sub ReleaseAFNObjects()
   Set AFNApplication = Nothing
End Sub

Private Sub AFNApplicationMTInstance_OnConnection(ByVal Application As AFNApplicationMT, ByVal MTDllInst As Object, Custom() As Variant)
   'Cache application object when a user logs in
   GetAFNObjects Application
   CustomConnect
End Sub

Private Sub AFNApplicationMTInstance_OnDisconnection(Custom() As Variant)
   'Release all objects when a user logs out
   ReleaseAFNObjects
   CustomDisconnect
End Sub

Private Sub CustomConnect()
'TODO: Add any custom connection code here

End Sub

Private Sub CustomDisconnect()
'TODO: Add any custom tear-down code here

End Sub
'--STANDARD CONNECTION CODE END-------------------------------

'---TODO: Add your macro code below this line---------------

Private Property Get IBBMacroProperties_Description(ByVal sMacroName As String) As String
   Select Case UCase(sMacroName)
       Case "TESTMACRO1"
           IBBMacroProperties_Description = "Test Macro 1"
       Case "TESTMACRO2"
           IBBMacroProperties_Description = "Test Macro 2"
   End Select
End Property

Private Property Get IBBMacroProperties_ImageFilePath(ByVal sMacroName As String) As String
   Select Case UCase(sMacroName)
       Case "TESTMACRO1"
           IBBMacroProperties_ImageFilePath = "C:\VBA Code\Toolbar Macro\gripBlue.gif"
   End Select
End Property

Private Property Get IBBMacroProperties_SupportedMetaObjects(ByVal sMacroName As String) As Variant
   Select Case UCase(sMacroName)
       Case "TESTMACRO1"
           IBBMacroProperties_SupportedMetaObjects = Array(bbmoGLAccount, bbmoAPInvoice)
       Case "TESTMACRO2"
           IBBMacroProperties_SupportedMetaObjects = Array(bbmoGLProject)
   End Select
End Property

Public Sub TestMacro1(ByRef oIBBDataObject As IBBDataObject)
   MsgBox "Demonstrating IBBMacroProperties"
End Sub

Public Sub TestMacro2(ByRef oIBBDataObject As IBBDataObject)
   MsgBox "Second macro in my test"
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.