Public Sub FormTest()
    Dim oAction     As CAction
    Dim oAction2    As IBBAction2
    Dim oNote       As IBBNotepad
    Dim oNoteForm   As CNotepadForm
    Dim oMove As IBBMoveServer
   
    Dim oActionForm As CActionForm
    Set oActionForm = New CActionForm
    oActionForm.Init REApplication.SessionContext
   
    '
    'load action
    Set oAction = New CAction
    oAction.Init REApplication.SessionContext
    oAction.Load 311
   

    '
   'open notepad form
    Set oAction2 = oAction
    Set oNoteForm = New CNotepadForm
    oNoteForm.Init REApplication.SessionContext
    Set oNoteForm.NotepadObjects = oAction2.Notepads
    'Exclude the following line to open a new Notepad form.
    oNoteForm.NotepadObjectID = 223
    oNoteForm.ShowForm Nothing

   
    '
    'close objects
   
    Set oAction = oAction2
    oAction.Save
    oNoteForm.Closedown
    Set oNoteForm = Nothing
   
'    oActionForm.Closedown
    Set oActionForm = Nothing
   
   
    oAction.Closedown
    Set oAction = 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.