Attachmate Worldwide  |   Contact Us  |   NetIQ.com
Home » Support » Solution Library

Technical Notes

Configuring VBA Events for Host Screen Text in Reflection for IBM 2007
Technical Note 2339
Last Reviewed 25-Apr-2008
Applies To
Reflection for IBM 2007
Summary

This technical note explains how to configure Reflection 2007 to automatically run certain actions when specified text is displayed in the host terminal session. These actions are configured in a VBA (Visual Basic for Applications) event handler. This information may be of particular interest to former users of EXTRA! X-treme that used HotSpots configured to "auto-invoke" actions.

Background for Former Users of EXTRA! X-treme

In both EXTRA! X-treme and Reflection for IBM 2007, you can configure HotSpots that enable you to click host text to send a terminal key function (for example, click "PF1" to send PF1). In EXTRA! X-treme, you could also configure actions to be automatically invoked when the HotSpot text is displayed in the host session. In Reflection for IBM 2007, such automatic actions must be configured in a VBA event instead of HotSpots, as explained below.

Creating a VBA Event Handler to Perform an Action

In Reflection for IBM 2007, events are exposed by the Reflection IbmScreen object. Follow these steps to create a VBA event handler with your desired code:

  1. Open a Reflection session.
  2. On the Ribbon, click the Tools tab and open the Visual Basic editor.
  3. In the Project panel on the left side of the editor, expand the Reflection Objects folder and double-click the ThisIbmScreen object. A code window opens.
  4. In the (General) drop-down list at the top of the code window, select the IbmScreen object.
  5. In the drop-down list to the right, which contains events associated with the selected object, click the NewScreenReady event. The following code is added to the code window automatically:
Private Sub IbmScreen_NewScreenReady(ByVal sender As Variant)

End sub

The NewScreenReady event will fire every time a new host screen is displayed in the terminal.

  1. Code can now be added to this event macro to identify which screen has been reached, and take any action that might be required. For example,
If ThisIbmScreen.GetText(1, 66, 14) = "APPLID CICS23A" And _
   ThisIbmScreen.GetText(10, 11, 14) = "Userid . . . ." Then

   'a particular screen is identified...do something...
End If

For more information on VBA programming, see Technical Note 2183.

Related Technical Notes
2183 Developer Tools for Attachmate Products
2211 Reflection for IBM 2007 Technical Notes

Did this technical note answer your question?

Yes    No    Somewhat     Not sure yet

Additional comments about this tech note:

Need further help? For technical support, please contact Support.