VBA Commands by Category

Application Class Objects

Session

Returns an object representing PowerTerm Pro current session.

Setup

Returns an object representing PowerTerm Pro current setup.

Application Class Properties

WordEmbedded

Microsoft Word embedded in PowerTerm Pro.

ExcelEmbedded

Microsoft Excel embedded in PowerTerm Pro.

InternBrowserEmbedded

Internet browser embedded in PowerTerm Pro.

Enumerations

AllocUnitTracks

An enumeration of allocation units tracks for file transfer.

Button

An enumeration of the GUI buttons available to users of the calculator.

Baudrates

An enumeration of baud rates for COM connection.

Parity

An enumeration of parity values for COM connection.

CommProtocol

An enumeration of protocol types (Flow Control) for COM connection.

FileTransferType

An enumeration of the file transfer type.

IndFileRecordFormat

An enumeration of record format for IBM file transfer.

IndFileTransferType

An enumeration of file transfer type for IBM emulation types.

FileTransferAsciiFlag

An enumeration of ASCII file transfer type flag.

StopBits

An enumeration of stop bits for COM connection.

LuCategory

An enumeration of LU Categories for NWSAA connection.

CommType

An enumeration of PowerTerm Pro communication types.

EmulationType

An enumeration of PowerTerm Pro Emulation Type.

EmbeddedAppl

An enumeration of applications that can be embedded.

ViewType

An enumeration of application views.

Application Class Methods

Exit

Exits PowerTerm Pro.

IsCommunicationOpen

Checks if communication is open.

KermitGetFile

Receives file using kermit protocol get command.

OpenPowerpadFile

Opens PowerPad file.

OpenKeyboardFile

Opens Keyboard file.

OpenSetupFile

Opens setup file.

StatusMessage

Displays status message.

ClearScreen

Clears screen.

SetRts

Sets the Ready To Send signal.

ClearRts

Clears the Ready To Send signal.

SetDtr

Sets the Data Terminal Ready signal.

ClearDtr

Clears the Data Terminal Ready signal.

SwitchToView

Switches to specific application view.

Wait

Waits for specific strings received from the host.

WaitForSystem

5250 emulations only. The command instructs PowerTerm to wait for the AS/400 to notify it when the AS/400 has finished processing a screen.

WaitForRecord

3270 emulations only. The command instructs PowerTerm to wait for the next screen record from the mainframe.

WaitForText

Waits for specific strings received from the host.

ShowWindow

Displays the PowerTerm Pro window.

HideWindow

Hides the PowerTerm Pro window.

RestoreWindow

Restores the PowerTerm Pro window.

MaximizeWindow

Maximizes the PowerTerm Pro window.

MinimizeWindow

Minimizes the PowerTerm Pro window.

SetwindowFocus

Activates the PowerTerm Pro window.

SetwindowTitle

Sets the text of the PowerTerm Pro window title bar.

SetWindowSize

Sets the PowerTerm Pro window size.

SetWindowPosition

Sets the PowerTerm Pro window position.

MoveWindow

Changes the position and dimensions of the PowerTerm Pro window.

Exec

Executes a command.

HideMenu

Hides the PowerTerm Pro menu.

GetEnv

Get a value from the current environment.

RestoreMenu

Restores the PowerTerm Pro menu.

GetScreenText

Copies complete lines from the starting position (startRow, startCol) up to and including the end position (endRow, endCol).

GetRectText

Copies the text found in the specified rectangle.

Display

Display a string on the current cursor position.

SetCursorPos

Moves the cursor to the specified screen coordinates.

SendBreak

Abort looping command.

SendAbortOutput

PrintFile

Prints the specified file.

PrintScreen

Prints the data presently displayed on the emulation screen.

RingBell

Rings the bell.

StartAuoPint

Starts accumulating incoming data (while it is displayed on the screen).

StopAutoPrint

Prints all the data accumulated in the printing buffer of the slave printer, or in the autoprint buffer.

ToggleAutoPrint

Alternates between the start autoprint and stop autoprint states.

LockColumns

Locks the number of columns thus preventing the user from making any modifications until he performs UnlockColumns.

UnlockColumns

Unlocks columns allowing for the user to change the number of columns.

OpenPrinterFile

Open specified printer file.

GetPrinterName

Returns the name of the printer you select.

AutoUpdatePrinter

Updates the printer setup from windows.

SetPadbutton

Programs the designated PowerPad button.

Message

Displays a message.

SetFunctionButton

Programs the designated Function button.

SendRawText

Sends uninterpreted text to host.

Send

Sends interpreted text to the host.

MapKeyToDefault

Configures a PC key to its default.

MapKeyToNull

Configures a PC key to be inoperable.

MapKeyToVtKey

Configures a PC key to send a VT key.

MapKeyToCommand

Configures a PC key to execute PSL commands.

MapKeyToScript

Configures a PC key to run a PSL script.

MapKeyToVbaMacro

Configures a PC key to execute VBA Macros.

Setcolor

Sets emulation screen color.

ExecEmbedded

Runs the specified program embedded in the PowerTerm Pro container view.

InputTrace

Executes capture file.

InputTraceEx

Executes capture file chosen from the dialog.

Session class Properties

EnabledSsl

Uses the Secure Sockets Layer protocol.

Usetn3270eProtocol

Uses the USETN327 protocol.

SessionName

Session name.

TelnetPort

Telnet port.

LuName

LU name.

TerminalName

Terminal name.

HostName

Host name.

DeviceName

Device name.

MessageQueue

An ordered list of messages awaiting transmission, from which they are taken up on a first-in, first-out (FIFO) basis.

Messagelibrary

Message Library.

AppcUserName

User Name.

AppcPassword

Password.

UseAvailableLu

Use available LU.

ServerName

Server name.

NodeName

Node name.

ServiceName

Device name.

BaudRate

Baud rate.

Parity

Parity.

FlowControl

Flow Control.

StopBits

Stop Bits.

LuCategory

LU category.

CommType

Comm type.

CommPortNumber

Comm port number.

DialNumber

Dial Number.

Methods of Session Class

Open.

Opens Communication.

Close

Closes Communication.

Modify

Modifies Communication.

Wait

Wait for specific strings received from the host.

SetTelnetParameters

Sets parameters for Telnet communication.

SetComParameters

Sets parameters for Comm communication.

For Setup

EmulationType

Emulation Type.

An example of VBA programming:

Goal: To create a dialog box that would facilitate making a connection with the host via PowerTerm Pro.

Step 1: From within the Microsoft VBA editor, click on the Project Explorer icon on the toolbar (or alternately select View menu|Project Explorer). The Project Explorer dialog box is displayed.

Step 2: Select Project from the right-hand pane and right-click.

Step 3: Click Insert|UserForm. A blank UserForm is displayed.

Step 4: Click on the Toolbox icon from the toolbar (or alternately select View menu|Toolbox) The Toolbox is displayed.

Step 5: Click on the Label icon from the toolbox. Drag it to UserForm and drop it.

Step 6: Repeat Step 5 three times.

Step 7: Select Label1 and right click to Properties.

Step 8: Change Caption to "Host".

Step 9: Select Label2 and right click to Properties.

Step 10: Change Caption to "User".

Step 11: Select Label3 and right click to Properties.

Step 12: Change Caption to "Password".

Step 13: Click on the Textbox icon from the toolbox. Drag it to the right of the Host label in the UserForm and drop it.

Step 14: Repeat Step 13 for both the User and Password labels.

Step 15: The following is code for the Auto login dialog:

Private Sub cmdconnect_Click()

On Error GoTo errorhandler

If main.host = "" Then

MsgBox "Please enter Host name", vbExclamation, "Host"

main.host.SetFocus

Exit Sub

End If

Session.HostName = main.host

Call Session.Modify

Call Session.Open("")

PtermPro.WaitForText user, 5, 0, 0

PtermPro.Send user & "<enter>"

Exit Sub

errorhandler:

MsgBox Err.Description, vbCritical, "Error"

End Sub