Private Function IbmScreen_BeforeSendControlKey(ByVal sender As Variant, key As Long) As Boolean
Dim screenRows As Integer
Dim screenColumns As Integer
Dim fnum As Integer
Dim screenShot As String
screenRows = ThisIbmScreen.rows
screenColumns = ThisIbmScreen.columns
'Get all the text on the screen
screenShot = ThisIbmScreen.GetTextEx(1, 1, screenRows, screenColumns, GetTextArea_Block, _
GetTextWrap_Off, GetTextAttr_Any, GetTextFlags_CRLF)
'Add a line to separate each screen
screenShot = screenShot & "................................................................................"
'Open a file and append the screenshot to the file
path = ThisIbmTerminal.SessionFilePath & ".log"
fnum = FreeFile()
Open path For Append As fnum
Print #fnum, screenShot
Close #fnum
Debug.Print path
IbmScreen_BeforeSendControlKey = True
End Function