Reflection Desktop VBA Guide
Attachmate.Reflection.Objects.Emulation.IbmHosts Library / Attachmate.Reflection.Objects.Emulation.IbmHosts Library / IbmScreen Object / SendControlKeySync Method
The ControlKeyCode Enumeration value that specifies the host control key to send to the host.
Example
In This Topic
    SendControlKeySync Method (IbmScreen)
    In This Topic
    Sends a host control key to the host.
    Syntax
    expression.SendControlKeySync( _
       ByVal keycode As ControlKeyCode _
    ) As ReturnCode
    where expression is a variable that represents a IbmScreen Object

    Parameters

    keycode
    The ControlKeyCode Enumeration value that specifies the host control key to send to the host.

    Return Value

    One of the following ReturnCode enum values.

    Member Description
    Cancelled Cancelled.
    Error Error.
    PermissionRequired Permission is required.
    Success Success.
    Timeout Timeout condition.
    Truncated The text is truncated.
    Remarks
    The method does not return until the screen has settled for the time duration measured by the ScreenSettleTime property.
    Example
    To run this sample, create a 3270 session and set the Host name / IP address to demo:ibm3270.sim. Then paste this code into a VBA module and run the macro from the login screen.
    Sub NavigateWithSendControlKeySyncMethod()
        'Declare application, terminal, and view object variables:
        Dim terminal As Attachmate_Reflection_Objects_Emulation_IbmHosts.IbmTerminal
        Dim screen As Attachmate_Reflection_Objects_Emulation_IbmHosts.IbmScreen
     
        Set terminal = ThisIbmTerminal
      
        'Get a handle to the Screen object and navigate to the screen we
        'want to enter the data on
        Set screen = terminal.screen
        
        'Set the screen settle time
        screen.ScreenSettleTime = 2000
      
        'Navigate to the screen
        rcode = screen.SendControlKeySync(ControlKeyCode_Transmit)
        
        'Go to a screen and get some data
        rcode = screen.SendKeys("kayak")
        rcode = screen.SendControlKeySync(ControlKeyCode_Transmit)
        text = screen.GetText(13, 66, 6)
     
        'Go back and navigate to another screen
        rcode = screen.SendControlKeySync(ControlKeyCode_F3)
        
        'Navigate to a screen and put the data into a field
        rcode = screen.SendKeys("ispf")
        rcode = screen.SendControlKeySync(ControlKeyCode_Transmit)
        
        rcode = screen.SendKeys("2")
        rcode = screen.SendControlKeySync(ControlKeyCode_Transmit)
        
        rcode = screen.PutText2(text, 5, 18)
        
    End Sub
    See Also