This macro copies text from a field on a screen in a Reflection demo program to a string variable. Then it creates another demo session, navigates to a screen on the new session, and puts the text into a field on that session.
If you prefer to run macros in pre-configured sessions instead of creating your own sessions, you can download the VBA Sample Sessions and open the copy-data-between-terminal-sessions.rd5x (IBM) and the copy-data-between-terminal-sessions.rdox (Open Systems) files. The download package contains everything you need to run the macros in these files. See Download the VBA Sample Sessions.
The following samples apply to IBM and Open Systems sessions.
This sample uses the GetText method to get the screen text from the current session.
Then it creates a session as discussed in Dynamically Open a Session.
After creating the new session, it uses the WaitForHostSettle, SendKeys, and SendControlKey methods to navigate through several screens in the new session to the screen with the Project field.
Finally, it uses the PutText2 method to put the text into field at the specified row and column for the new session.