Reflection Desktop VBA Guide
Attachmate.Reflection.Objects Library / Attachmate.Reflection.Objects.Productivity Library / ScreenHistory Object / CaptureScreen Method
Example
In This Topic
    CaptureScreen Method
    In This Topic
    Captures the current host screen, including any data in non-hidden fields, and adds it to the Screen History list.
    Syntax
    expression.CaptureScreen() 
    where expression is a variable that represents a ScreenHistory Object
    Remarks
    If data in an unprotected field matches one or more currently enforced privacy filters, the first matching filter will replace the data in the screen capture image.

    For more about the CaptureScreen method, see:

    Using the Reflection Object Model

    Example

    This sample captures a specific screen in screen history when the screen opens. Other screens are not captured.

    To run this sample, create an Ibm3270 session with the host IP address set to demo:ibm3270.sim and then paste the code into the ThisIbmScreen code window. From the VBA editor View menu, choose Immediate Window. Then enter any credentials to log in and then enter kayak. On the Session ribbon, click Screen history to see the results.

    Private Sub IbmScreen_NewScreenReady(ByVal sender As Variant)
     
        Dim ScreenID As String
        Dim ScreenText As String
        
        ScreenID = "KAYAK"
        
        ScreenText = ThisIbmScreen.GetText(1, 39, 5)
        
        ThisIbmTerminal.Productivity.screenhistory.ManualCaptureOnly = True
        
        'If the screenID is on the screen, capture it
        
        If ScreenText = ScreenID Then
            Debug.Print "on the screen"
            
            ThisIbmTerminal.Productivity.screenhistory.CaptureScreen
            
        End If
     
     
    End Sub
    See Also