Reflection Desktop VBA Guide
Attachmate.Reflection.Objects Library / Attachmate.Reflection.Objects.UserInterface Library / View Object / Control Property
Example
In This Topic
    Control Property
    In This Topic
    Gets the control object embedded in the view.
    Syntax
    expression.Control As Object
    where expression is a variable that represents a View Object
    Example

    This example prints the type of terminal along with some other information when a session view opens.

    To run this example, copy this code to the ThisFrame code window under the Common Project. You may need to add a reference to the Attachmate_Reflection_Objects_Emulation_OpenSystems library.

    Private Sub Frame_ViewOpened(ByVal sender As Variant, ByVal View As Attachmate_Reflection_Objects.View)
        
        Dim terminal As Attachmate_Reflection_Objects_Emulation_IbmHosts.IbmTerminal
        Dim terminalOs As Attachmate_Reflection_Objects_Emulation_OpenSystems.terminal
        Dim HostAddress As String
        Dim ConnectionType As String
        Dim port As Integer
       
        'print terminal type
        If TypeName(View.control) = "IbmTerminal" Then
      
            Set terminal = View.control
            
            HostAddress = terminal.HostAddress
            port = terminal.port
            
            Debug.Print "IBM", HostAddress, port
        
        ElseIf TypeName(View.control) = "Terminal" Then
     
            Set terminalOs = View.control
            
            'Check whether the connection is SSH
            If Not terminalOs.ConnectionType = ConnectionTypeOption_SecureShell Then
                   Debug.Print "This is not an SSH connection"
            End If
            
            Debug.Print "Open Systems"
            
        End If
    End Sub
    See Also