6.2.1 Record a Macro

You can record a macro to automate your interaction with host applications, including:

  • Sending data to, or typing text in, a host application.

  • Cutting, copying, or pasting text or data from one host application to another.

  • Switching tabs to move from one host application to another.

  • Selecting text with a mouse or clicking the mouse to move the cursor (mouse clicks are recorded as cursor positions.)

You cannot record:

  • Interaction with InfoConnect settings and Productivity features (such as Spell Check, Auto Expand, and Auto Complete).

  • Connecting to or disconnecting from a host.

  • Interaction with Web applications.

  • Cutting or pasting from a host to an external application (for example, Notepad).

To record a macro

  1. Start a session and select Record Macro.

    The steps depend on your user interface mode.

    Ribbon

    For IBM3270 and IBM5250 terminals: On the Macrosribbon, from the Advancedgroup, clickRecord VBA.

    For all other terminals: On the Toolsribbon, from the Macrosgroup, clickRecord VBA Macro.

    InfoConnect Browser

    On the InfoConnect menu, choose Tools, Macroand then Record VBA Macro.

    TouchUX

    Tap the Wrench icon, and then under Macro, select Record VBA Macro.

    Classic MDI

    From the Macro menu, select Record VBA Macro.

  2. Perform the task(s) that you want to automate.

  3. (Optional) If you need to interrupt the recording to perform another task, click Pause Recording. When you are ready to resume recording, click Pause Recordingagain.

  4. When you are finished recording the macro, click Stop Recording.

    The Recording Complete dialog box appears.

  5. Name the macro, choose the location where you want to save it, and then click OK.

  6. If you want to run the macro every time the session connects, select Make this the Connect Macro.

NOTE:

  • The recorder creates two macros —the macro you named and an “ExternalRecorded” macro, which is called by the macro you named and contains the recorded code.

  • You can fine-tune recorded macros by using the Visual Basic Editor. For more information, see Edit a Macro.

Related Topics