我公司最近从 Attachmate EXTRA 升级!附加反射。我们有许多在屏幕抓取时额外运行的宏。基本上,你会按下一个按钮来启动宏,它会要求你选择你想在哪个额外的屏幕上运行它(我们总是为不同的系统打开 3+),然后宏将只使用最近选择的(主动)会话。这是代码:
Private Function GetReflectionWindow(sessionName As String) As ExtraScreen
'Gets the most recent active reflection or extra window.
'Requires Reference: EXTRACOM
Dim sys As ExtraSystem: Set sys = CreateObject("EXTRA.System")
Dim sess As ExtraSession
'Set current sesion to most recently active session
If MsgBox("Click on the " & sessionName & " session and click 'OK' to continue.", vbOKCancel) = vbCancel Then End
Set sess = sys.ActiveSession
'Checks the session
If sess Is Nothing Then
MsgBox "Could not locate a Reflection or Extra session!", vbCritical
End
Else
Set GetReflectionWindow = sess.Screen
sess.Activate
End If
End Function
这不再适用于反射系统。相反,我在这里查看了此文档。问题是当您使用 CreateObject 或 GetObject 时,它只查看第一个打开的实例,而不是活动的实例。
Sub GetNewReflectionWindow()
Dim App As Attachmate_Reflection_Objects_Framework.ApplicationObject
Dim screen As Attachmate_Reflection_Objects_Emulation_IbmHosts.IbmScreen
Dim Terminal As Attachmate_Reflection_Objects_Emulation_IbmHosts.IbmTerminal
Dim Frame As Attachmate_Reflection_Objects.Frame
Dim View As Attachmate_Reflection_Objects.View
Set App = GetObject(, "Attachmate_Reflection_Objects_Framework.ApplicationObject")
End Sub
我在文档或对象浏览器中看不到任何可以让我像 Extra.System 那样选择活动会话的内容。