Reflection Desktop VBA Guide
Attachmate.Reflection.Objects Library / Attachmate.Reflection.Objects.UserInterface Library / View 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 (View)
    In This Topic
    Closes the view.
    Syntax
    expression.Close( _
       ByVal option As CloseOption _
    ) As ReturnCode
    where expression is a variable that represents a View 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 values:

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

    Example

    This example creates a session, waits a few seconds, and closes the session.
    Sub CreateAndCloseReflectionIBMSession()
        'Declare application, terminal, and view object variables:
        Dim app As Attachmate_Reflection_Objects_Framework.ApplicationObject
        Dim terminal As Attachmate_Reflection_Objects_Emulation_IbmHosts.IbmTerminal
        Dim view As Attachmate_Reflection_Objects.view
         
        'Get a handle to the workspace
        Set app = GetObject("Reflection Workspace")
                     
        'Create an Ibm3270 control and set the host address
        Set terminal = app.CreateControl2("{09E5A1B4-0BA6-4546-A27D-FE4762B7ACE1}")
        terminal.HostAddress = "demo:ibm3270.sim"
        terminal.port = "623"
       
        'For an Ibm5250 control, use the following Guid:
        'Set terminal = app.CreateControl2("{AF03A446-F278-4624-B9EF-C896DF2CA1CA}" )
       
        'Create a view to display the session
        Set view = ThisFrame.CreateView(terminal)
        
        'perform commands for your session...
        app.Wait (3000)
        
        'close the session without saving
        view.Close CloseOption_CloseNoSave
       
    End Sub
    See Also