expression.CaptureScreen()
where expression is a variable that represents a ScreenHistory Object
expression.CaptureScreen()
For more about the CaptureScreen method, see:
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
Sub CaptureAScreenAndSave() Dim shistory As ScreenHistory Dim rcode As ReturnCode Dim filename As String 'Check or set the file name for the screen filename = InputBox("Save current screen image to:", , Environ("USERPROFILE") & "\Documents\Micro Focus\Reflection\Screen.rshx") 'Get the history object and capture a screen Set shistory = ThisIbmTerminal.Productivity.ScreenHistory shistory.CaptureScreen 'Save the screen to a screen history file rcode = shistory.SaveScreenHistoryFile(filename, True) 'Clear the screen history and close the screen history panel shistory.ClearAllScreens End Sub