Sub MapActionToControl()
Dim sequence As InputMapActionSequence
Dim action As InputMapAction
Dim control As UiControl
Dim ui As UiMode
'Set an InputMapActionSequence to map the button to.
Set sequence = New InputMapActionSequence
'Set an action to add to the sequence.
Set action = New InputMapAction
'Set the action to run a macro named GetReport.
action.ActionId = InputMapActionID_RunMacroAction
action.AddParameter "Module1.GetReport" 'Set the name of the macro.
action.AddParameterAsInteger MacroEnumerationOption_Document 'Look for the macro in this Session project.
action.AddParameterAsBoolean False 'Don't ask for any input at runtime.
'Add the action to the action sequence
sequence.Add action
'Get the control from the control ID. You'll need to get this value from the UI Designer. In this example, the control ID is "button7"
'Edit this line to use the ID of your button.
Set control = ThisView.UiMode.GetControlById("button7")
'Add the action sequence to the control
ThisIbmTerminal.UiControlActionMapper.Add control, sequence
End Sub