

#Macro recorder controller code#
To run the macro from the editor, place the cursor in the code window and press F5. The VBA code for the recorded macro is displayed in the code window. In the Visual Basic Editor Project Explorer window, open the Project folder and then in the Modules folder, select Recorded and then select the module that has the name of the macro.Open a Word document and paste the data into the document.Copy some other data to the clipboard so you can test the macro.Select and copy some data on the screen.In an InfoConnect VT terminal session, on the Tools tab, select Record Macro.The recorded macro code is displayed in the code window. Open a Word document and paste the data copied by the macro into the document.Select Run Macro and then run the new macro you just recorded.Select and copy some other data so you can test the macro.Select Stop Recording and then save the recorded macro in the current document's project.Right click on the selected text and then select Copy.

#Macro recorder controller how to#
This example shows how to record a macro that copies data to the clipboard. It also shows how to modify the recorded code to disconnect the session after the data is copied. Recording a well thought out and planned macro will lead to the best results. Recording a macro slowly and carefully does not cause the macro to run with reduced performance, as macros always run at the fastest speed possible during playback. (Do not attempt to manually remove code blocks unless you have a good knowledge of the VBA programming language and syntax, as well as knowledge of the host screens being navigated.) If your macro is not working as expected after recording it again, manually edit the macro in the VBA editor to remove duplicate blocks of code that were created while recording. If your macro doesn’t play back like you expect, delete the macro and carefully record it again using slow and deliberate steps. While recording the macro, after pressing a key to submit data to the host, wait for the next host screen to fully appear (sometimes even waiting a few extra seconds) before pressing the next keys. Plan in advance of the recording to make sure you know the steps you will follow, which keys you will press, and which host screens are anticipated. Following these best practices will lead to the best results. Typing very fast while recording or typing ahead in a session, while connected with a slow network connection can cause your macro to play back in unexpected ways. Use the following best practices to carefully record your macro will help prevent problems that can occasionally occur when using a slower network connection. If you are working with an unstructured display format (such as Open Systems terminals), you'll probably find it useful to record a macro and then look at the recorded code to get information such as the strings returned by a host or the screen positions of selected data. After you save a recorded macro, you can edit it in the Visual Basic editor to add functionality and make it easier to maintain. Recording a macro is an easy way to get started on a more complex macro. Cutting or pasting from a host to an external application (for example, Notepad).Connecting to or disconnecting from a host.Interaction with InfoConnect settings and Productivity features (such as Spell Check, Auto Expand, and Auto Complete).Switching tabs to move from one host application to another.Cutting, copying, or pasting text or data from one host application to another.Sending data to, or typing text in, a host application.In This Topic You can record macros to automate the following types of actions:
