Reflection Desktop VBA Guide
Attachmate.Reflection.Objects.Emulation.IbmHosts Library / Attachmate.Reflection.Objects.Emulation.IbmHosts Library / InputMapAction Object / AddParameter Method
The parameter value to add. The value must be non-null.
Example
AddParameter Method (InputMapAction)
Appends a parameter to the end of the action's parameter list.
Syntax
expression.AddParameter( _
   ByVal param As String _
) 
where expression is a variable that represents a InputMapAction Object

Parameters

param
The parameter value to add. The value must be non-null.
Remarks

For more about using the AddParameter method, see:

Change Keyboard Mapping on-the-fly

Example

This example maps the Ctrl+B key to a simple macro that gets text from the screen and displays it in a message box.

To run this sample, copy the code into a code module named "Module1". Then click the screen and press Ctrl+B.

Public Sub MapKeyToMacro()
    Dim kbmapping As KeyboardMapping
    Dim sequence As InputMapActionSequence
    Dim action As InputMapAction
 
    Set kbmapping = New KeyboardMapping
    Set sequence = New InputMapActionSequence
    Set action = New InputMapAction
                         
    'Set up the action to run a recorded macro named CopyData
    action.ActionId = InputMapActionID_RunMacroAction
    action.AddParameter "Module1.CopyData"
 
    'Look for the macro in this Session project
    action.AddParameterAsInteger MacroEnumerationOption.MacroEnumerationOption_Document
 
    'Don't ask for any input at runtime
    action.AddParameterAsBoolean False
 
    'Add the action to the action sequence
    sequence.Add action
    'Assign the Ctrl+B key combination to the new action
     kbmapping.key = Keys_Control + Keys_B
 
    'Map the key assigned  to the keyboard mapping to the sequence
    Set kbmapping.mapping = sequence
 
    'Add the new mapping to the session keyboard map
    ThisIbmTerminal.KeyboardMapper.AddMapping kbmapping
                          
End Sub
 
Sub CopyData()
    Dim data As String
    data = "The first line contains " & ThisIbmScreen.GetText(1, 2, 80)
    MsgBox data
End Sub
See Also