Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Andrzejek on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Reflection Workspace extract all screen/pages

Status
Not open for further replies.

SSS27

Technical User
Oct 4, 2024
1
Hi Good People,

Currently I am working on a tool that would extract Reflection Workspace data to an excel file.
The proble is, there are multiple pages or screen of a specific screen. Like for example. I managed to copy the first page of the screen, then you have to
press page down key inorder to get to the next page, and so on..

My question is, is there a solution to extract all the remaining screen up to the last page of a particular screen? so far below is my running code.

This is a code came from Reflection Workspace Recording and I just modify it a little..
Sub Test()

Dim osCurrentScreen As Screen
Dim osCurrentTerminal As Terminal
Dim returnValue As Integer

Set osCurrentTerminal = ThisFrame.Selectedview.Control
Set osCurrentScreen = osCurrentTerminal.Screen

osCurrentScreen.SelectText 6, 4, 16, 128, RegionOption_Rectangular
osCurrentScreen.Copy

With CreateObject("Excel.Application")
.Workbooks.Add
.Visible = True

.Range("A1").PasteSpecial Paste:=xlPasteAll

End With

End Sub

This is a code I test and got from other site. This identify all the active Reflection Session. I wanted to modify it with my goal, but dunno where to begin with.

Option Explicit
'Returns a Collection object that contains all open Reflection Frame objects
Function GetAllFrames() As Collection
Dim Frames As New Collection
Dim rApp As Attachmate_Reflection_Objects_Framework.ApplicationObject

On Error Resume Next

'By default, all Reflection Application objects will have the
'"AutomationServerName" of "Reflection Workspace".
'So, this method of discovering all currently-running Application
'objects works as long as you have not used another program
'that changes the default value on these to something else.
Do
Set rApp = GetObject("Reflection Workspace")
If Err = 0 Then
Frames.Add rApp.GetObject("Frame")
rApp.AutomationServerName = "already got this one"
Else
Err.Clear
Exit Do
End If
Loop

'Reset back to the original AutomationServerName...
Do
Set rApp = GetObject("already got this one")
If Err = 0 Then
rApp.AutomationServerName = "Reflection Workspace"
Else
Err.Clear
Exit Do
End If
Loop

Set GetAllFrames = Frames
End Function

'Returns a Collection object that contains all open Views
'in all Open Reflection Frame objects.
Function GetAllViews() As Collection
Dim Frames As Collection
Dim Views As New Collection
Dim i As Long
Dim f As Frame

Set Frames = GetAllFrames()

For Each f In Frames
If f.ViewCount <> 0 Then
For i = 1 To f.ViewCount
Views.Add f.View(i)
Next
End If
Next

Set GetAllViews = Views
End Function


'test...
Sub ReportAllViewTitles()
Dim Views As Collection
Dim v As View

Set Views = GetAllViews()
For Each v In Views
Debug.Print v.titleText
Next
End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top