×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Need to get the full path of open Reflection Session

Need to get the full path of open Reflection Session

Need to get the full path of open Reflection Session

(OP)
Hey,

Is there a way to get the full path of an open Reflection session ?? e.g C:\Documents and Settings\...\Reflection.rd3x

On my system the Reflection session is stored in a folder in "My Documents". But thats not necessarily the same location the client will store his session. The following code works perfectly if Reflection.rd3x is in the location as specified.

Set objWSHShell = CreateObject("WScript.Shell")
strSpecialFolderPath = objWSHShell.SpecialFolders("MyDocuments") & "\Reflection\Reflection.rd3x"
Terminals = App.GetControlsByFilePath(strSpecialFolderPath)

When I run this macro, i have the Reflection session already open. Is there any way to find out the entire path of the open session ?? I cant seem to find any working solution anywhere (and I HAVE looked !).

Please, any assistance would be highly aprreciated !!

RE: Need to get the full path of open Reflection Session

hi,

Whatever your system object is...

CODE

dim oSess as object
  for each oSess in YourSystemObject.sessions
     debug.print oSess.Name, oSess.Path
  next 

Skip,

glassesJust traded in my old subtlety...
for a NUANCE!tongue

RE: Need to get the full path of open Reflection Session

(OP)
Hi Skip,

Thanks for replying so quickly. I'm new to VBA in Attachmate so i'm not really sure how to implement what you just said. I am attaching a code snippet of what I have so far.

CODE -->

Dim oSess As Object
 On Error Resume Next
  Set App = GetObject("Reflection Workspace")
    On Error GoTo 0
    If IsEmpty(App) Or (App Is Nothing) Then
        MsgBox "Need to open reflection first"
        Exit Sub
    End If
    Set Frame = App.GetObject("Frame")  
    Frame.Visible = True  
          
    Dim objWSHShell As Object
    Dim strSpecialFolderPath
    Set objWSHShell = CreateObject("WScript.Shell")
    strSpecialFolderPath = objWSHShell.SpecialFolders("MyDocuments") & "\" & "Attachmate\Reflection\Reflection.rd3x"
    Set objWSHShell = Nothing
    Terminals = App.GetControlsByFilePath(strSpecialFolderPath) 

I tried doing as you suggested, like this

CODE -->

For Each oSess In App.Sessions
        Debug.Print oSess.Name, oSess.Path
    Next 
But I am getting an error saying that the Object does not support this property. What am I doing wrong ??

RE: Need to get the full path of open Reflection Session

Error on WHAT statement?

BTW, I very rarely code in the Attachmate Editor.

I mych rather drive a Rolls Royce than a Yugo, so I code in Excel VBA, since I am always starting with Excel data and/or ending up with data in Excel--so my advise is FAQ707-4594: How to use the Watch Window as a Power Programming Tool.

Skip,

glassesJust traded in my old subtlety...
for a NUANCE!tongue

RE: Need to get the full path of open Reflection Session

(OP)
Sorry ! I am getting the error in the line

CODE -->

For Each oSess In App.Sessions 
I'm guessing App.Sessions is whats causing the problem. I am also coding in Excel VBA and not in Attachmate Editor.

Using the Watch window, I cannot seem to find the File path but I did get the InstanceID through the Frame object.

CODE -->

id_i = Frame.SelectedView.InstanceId 

But I'm back to square one because when I try this

CODE -->

Terminals = App.GetControlByInstanceId(id_i) 
I get an error saying "Automation Error:Invalid Pointer"...Any thoughts ??

RE: Need to get the full path of open Reflection Session

???

My experience is with Attachmate Extra.

Skip,

glassesJust traded in my old subtlety...
for a NUANCE!tongue

RE: Need to get the full path of open Reflection Session

Try strSpecialFolderPath = Session.SettingsFile

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close