Reflection Desktop VBA Guide
Attachmate.Reflection.Objects.Emulation.OpenSystems Library / Attachmate.Reflection.Objects.Emulation.OpenSystems Library / Printing Object / PrinterLogging Property
Example
In This Topic
    PrinterLogging Property
    In This Topic

    Gets or sets whether data received into display memory, either from datacomm or from the keyboard, is sent to the printer (or to a file) when a linefeed is received.

    Syntax
    expression.PrinterLogging As Boolean
    where expression is a variable that represents a Printing Object

    Property Value

    The default value is False.

    Remarks

    The value of this property is not saved to a settings file.

    In Reflection for HP, turning on Record Mode automatically sets PrinterLogging to False.

    To log to a file instead of the printer, do the following:

    • Make sure PrinterLogging is set to True.
    • Set the PrintToFile property to a valid file name.

    Reflection doesn't log a line of data until it encounters a linefeed.

    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