Reflection Desktop VBA Guide
Attachmate.Reflection.Objects.Emulation.OpenSystems Library / Attachmate.Reflection.Objects.Emulation.OpenSystems Library / Terminal Object / Close Method
A CloseOption value. You can specify CloseOption_CloseAlwaysSave to save the session configuration before closing or CloseOption_CloseNoSave to close the session without saving. You cannot choose to prompt the user to save the session.
Example
In This Topic
    Close Method (Terminal)
    In This Topic
    Closes the terminal session with the close option.
    Syntax
    expression.Close( _
       ByVal option As CloseOption _
    ) As ReturnCode
    where expression is a variable that represents a Terminal Object

    Parameters

    option
    A CloseOption value. You can specify CloseOption_CloseAlwaysSave to save the session configuration before closing or CloseOption_CloseNoSave to close the session without saving. You cannot choose to prompt the user to save the session.

    Return Value

    One of the following ReturnCode enumeration values.

    Member Description
    Cancelled Cancelled.
    Error Error.
    PermissionRequired Permission is required.
    Success Success.
    Timeout Timeout condition.
    Truncated The text is truncated.

    Example
    This example opens a session, saves it with a new file name to effectively copy it, and closes the session without saving it.
    Sub OpenAndSaveReflectionOpenSystems()
        'Declare application, terminal, and view object variables:
        Dim app As Attachmate_Reflection_Objects_Framework.ApplicationObject
        Dim terminal As Attachmate_Reflection_Objects_Emulation_OpenSystems.terminal
        Dim view As Attachmate_Reflection_Objects.view
        Dim rcode As ReturnCode
        Dim path As String
        
        path = Environ("USERPROFILE") & "\Documents\Micro Focus\Reflection\"
         
        'Get a handle to the workspace
        Set app = GetObject("Reflection Workspace")
                     
        'Open a session document file
        Set terminal = app.CreateControl(path & "demo.rdox")
           
        'Create a view to display the session
        Set view = ThisFrame.CreateView(terminal)
        
        'Save the session with a new name
        rcode = terminal.SaveAs(path & "myNewSession.rdox")
        
        'Perform other commands
        
        'Close the session
        terminal.Close CloseOption_CloseNoSave
       
    End Sub
    See Also