Reflection Desktop VBA Guide
In This Topic
    Get Object
    In This Topic

    In Reflection, GetObject calls can only support one type of legacy object, based on your Legacy API preference. For example, if you want GetObject to return the Extra! session object instead of the legacy Reflection session object, you will need to specify Extra! as the preferred API type in the Legacy API preference. For more information, see the Reflection Help.

    In this example, GetObject attaches to a running instance of by using the Automation server name (the default AutomationServerName value " Workspace"). This technique allows you to identify a particular instance even if multiple instances are active.

    Dim ApplicationObject As Attachmate_Reflection_Objects_Framework.ApplicationObject
    Set ApplicationObject = GetObject("Reflection Workspace")
    ApplicationObject.CreateControl("C:\Users\[Username]\Documents\OpenText\Reflection\MySession.rd5x")
    

    In this second example, GetObject attaches to a running instance of Reflection . The comma after GetObject indicates that the first argument has been omitted. The line continuation character, an underscore preceded by a space, is used to break up the long line of code.

    Dim App As Attachmate_Reflection_Objects_Framework.ApplicationObject
    Set App = GetObject(, _ "Attachmate_Reflection_Objects_Framework.ApplicationObject")
    

    In this last example, GetObject opens a new instance of Reflection by returning a reference to the ApplicationObject object. The first argument includes an empty string. The line continuation character, an underscore preceded by a space, is used to break up the long line of code.

    Dim App As Attachmate_Reflection_Objects_Framework.ApplicationObject
    Set App = GetObject("", _ "Attachmate_Reflection_Objects_Framework.ApplicationObject")