Reflection Desktop VBA Guide
Attachmate.Reflection.Objects.Emulation.IbmHosts Library / Attachmate.Reflection.Objects.Emulation.IbmHosts Library / IbmTerminal Object / ConnectAction Property
Example
In This Topic
    ConnectAction Property (IbmTerminal)
    In This Topic
    Gets or sets a sequence of action(s), such as running a macro, to run automatically after a connection is established.
    Syntax
    expression.ConnectAction As InputMapActionSequence
    where expression is a variable that represents a IbmTerminal Object

    Property Value

    An InputMapActionSequence object.
    Exceptions
    ExceptionDescription
    This exception is thrown if the set parameter is longer than the maximum allowed.
    This exception is thrown when you modify a property that was secured via the Permissions Manager or that can only be modified by an Administrator.
    Remarks
    Connect action sequences run after the terminal has successfully made a connection to the host. They should not include session setup information.
    Example
    This example configures a session to run a connection macro named CopyData.
    'Set up a session to run a connection macro
    Public Sub AddConnectMacro()
     
        Dim sequence As InputMapActionSequence
        Dim action As InputMapAction
     
        Set sequence = New InputMapActionSequence
        Set action = New InputMapAction
     
        'Set up the action to run a macro named CopyData
        action.ActionId = InputMapActionID_RunMacroAction
     
        action.AddParameter "SharedMacros.ThisIbmTerminal.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
     
        'Set the macro to run when the session connects or reconnects
        Set ThisIbmTerminal.ConnectAction = sequence
     
        ThisIbmTerminal.RunMacroAtReconnect = True
     
    End Sub
    See Also