Reflection Desktop VBA Guide
Attachmate.Reflection.Objects.Emulation.IbmHosts Library / Attachmate.Reflection.Objects.Emulation.IbmHosts Library / IbmScreen Object / CancelSelection Method
Example
In This Topic
    CancelSelection Method
    In This Topic
    Cancels the text selection in the terminal window. If no text is selected, this method has no effect.
    Syntax
    expression.CancelSelection() 
    where expression is a variable that represents a IbmScreen Object
    Example

    This sample selects the entire screen area and copies it to the clipboard. If the screen contains the "PASSWORD" field, it is unslected and the text is not copied.

    To run this sample in the demo session, Open an ibm3270 session with the host IP address set to demo:ibm3270.sim. Then paste the code into the ThisIbmScreen code window. Enter any credentials to log in and then enter "ispf" to go to the next screen. Then paste the contents of the clipboard to a text editor. Check that the screen that contains PASSWORD is not copied.

    Private Sub IbmScreen_NewScreenReady(ByVal sender As Variant)
        
        ThisIbmScreen.SelectAll
     
        
        If ThisIbmScreen.GetText(21, 2, 8) = "PASSWORD" Then
            ThisIbmScreen.CancelSelection
        End If
        
        ThisIbmScreen.CopyAppend
        
        
    End Sub
    See Also