This sample saves an image of a screen immediately before the screen data is transmitted and then appends the image to a Word file.
If you prefer to run macros in pre-configured sessions instead of creating your own sessions, you can download the VBA Sample Sessions and open the save-screens-to-word.rd3x (IBM) file. The download package contains everything you need to run the macros in this file. See Download the VBA Sample Sessions.
This sample applies only to IBM terminals
This sample handles the BeforeSendControlKey event to run the PutImagesInWordDocument Sub every time the program exits a screen.
PutImagesInWordDocument gets an image of the screen using the GetLiveScreenImage() method on the ScreenHistory object and saves it to a binary file. It assigns an instance of Microsoft Word to the myWordApp variable. Then it gets the log.docx document (if it is open) or opens it and assigns it to the myWordDoc variable.
Finally, it inserts a timestamp, the image of the screen in the binary file, and the user environment to the Word document and saves the document.