Reflection Desktop VBA Guide
Attachmate.Reflection.Objects.Framework Library / Attachmate.Reflection.Objects.Framework Library / ApplicationObject Object / CreateControl Method
The fully qualified path to the session document file.
CreateControl Method
Create a control by opening a session document file.
Syntax
expression.CreateControl( _
   ByVal sessionFilePath As String _
) As Object
where expression is a variable that represents a ApplicationObject Object

Parameters

sessionFilePath
The fully qualified path to the session document file.

Return Value

A terminal control
Remarks
Example

This sample creates a control by opening a session document file. Before you run the sample, create and save a session document.

Sub OpenSessionDocument()    
     ' Objects required to open a new session
     Dim app As Attachmate_Reflection_Objects_Framework.ApplicationObject
     Dim terminal As Attachmate_Reflection_Objects_Emulation_IbmHosts.IbmTerminal
     Dim view As Attachmate_Reflection_Objects.View
 
     Dim sessionPath As String     
 
     'Get a handle to the existing application object (the workspace)
     Set app = GetObject("Reflection Workspace")
 
     'Create a terminal control for the new session
     sessionPath = Environ$("USERPROFILE") & "\Documents\Micro Focus\Reflection\" & "gettingStarted.rd3x"
     Set terminal = app.CreateControl(sessionPath)
 
     'Create the view used to display the session
     Set view = ThisFrame.CreateView(terminal)
 End Sub

 

Sub OpenSessionDocument()   
    'Objects required to open a new session
     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 sessionPath As String
     'Get a handle to the existing application object (the workspace)
     Set app = GetObject("Reflection Workspace")
   
     'Create a terminal control for the new session
     sessionPath = Environ$("USERPROFILE") & "\Documents\Micro Focus\Reflection\" & "gettingStarted.rdox"
     Set terminal = app.CreateControl(sessionPath)
 
     'Create the view used to display the session
     Set view = ThisFrame.CreateView(terminal)
 End Sub
See Also