Macro Sample Index
PASSPORT PC TO HOST, PASSPORT WEB TO HOST
TN3270, TN5250, VT, SCO ANSI, Wyse 60
Each of the sample macros will have a description detailing what the macro is used for, which type of macro it is, along with the sample code. Anyone wishing to use one of the sample macros simply needs to copy the sample code, paste into Notepad or any text editor, then save in the appropriate file format. In some cases there may be modifications necessary for the macro to work in your environment. For example, a macro that interfaces with the Windows File System Object (Scripting.FileSystemObject) may need to be modified to create or open a particular file on the local computer. In this case appropriate permissions are also necessary for the macro to execute properly.
Below is a list of macros in the Macro Sample Library:
Dialog Box With Password Input
This macro will demonstrate how to display a dialog box and prompt for a password, which is masked (hidden) when the user types. The password is saved in a variable, which may be used to perform some other function.
Email Host Screen From Emulator
This macro will email the current PASSPORT screen to one or more user provided email addresses using Microsoft Outlook. A temporary file is used to store the contents of the screen (C:\Program Files\PASSPORT\temp.txt by default), which the user must have write access to. When prompted, the user will input one or more email addresses separated by semi-colons then click the OK button or the Enter key on the keyboard. Each time the macro is run this file is overwritten with the contents of the new screen.
Export Host Screen To Excel Spreadsheet
This macro will prompt the user for a path and filename then export the current PASSPORT screen to the specified Excel spreadsheet where each row of the host screen is placed into a new row within the spreadsheet. If the file exists, the user will be prompted whether or not the file should be overwritten.
Export Host Screen To Word Document
This macro will export the current PASSPORT screen to a new Word Document where each row of the host screen is placed into a new row within the document. The user may then save the file as needed.
Logon Macro Using WaitForCursorPos and WaitForString Functions
This macro will logon to TSO, wait for specific text to appear on the screen, then access the ISPF main menu using the WaitForCursorPos and WaitForString functions. Each of the SendHostKeys, WaitForCursorPos and WaitForString statements must be modified for use with your host. Also, USERID and USERPASSWORD must be replaced with a valid username and password.
Maintain Copy Selection Through Multiple Screens
This macro will copy the text from the specified area of the screen, advance to the next screen (using PF12), then perform the Copy Append command. The Copy Append is repeated the number of times specified in the For Next loop statement.
macro, sample, library, index