InfoConnect VBA Guide
Attachmate.Reflection.Objects.Emulation.OpenSystems Library / Terminal Object / StartLogging Method
Example
In This Topic
StartLogging Method
In This Topic
Start logging terminal activity.
Syntax
expression.StartLogging() 
where expression is a variable that represents a Terminal Object
Example
This example logs commands and data entered and received and saves it in a text file when logging is stopped. To run this sample, copy the code to the ThisTerminal code window.
Private Sub Terminal_Connected(ByVal sender As Variant, ByVal ConnectionID As Long, ByVal connnectionType As Attachmate_Reflection_Objects_Emulation_OpenSystems.ConnectionTypeOption, ByVal connectionSettings As Variant)
 
    'Start capturing text to a file:
    ThisScreen.ScreenPrinting.PrinterLogging = True
    ThisScreen.ScreenPrinting.PrintToFile = Environ$("USERPROFILE") & "\Documents" & "\test.txt"
    ThisTerminal.StartLogging
    
End Sub
 
Private Sub Terminal_Disconnected(ByVal sender As Variant, ByVal ConnectionID As Long, ByVal connnectionType As Attachmate_Reflection_Objects_Emulation_OpenSystems.ConnectionTypeOption, ByVal connectionSettings As Variant)
    
    'Stop capturing text to a file:
    ThisScreen.ScreenPrinting.PrinterLogging = False
    ThisTerminal.StopLogging
    
End Sub
See Also