Example

This example checks to see if Telnet is the current transport type. If it is, a message box is displayed saying that Telnet is already configured. If any other transport is configured, the SetupSession method is used to change to Telnet. The SessionType and TerminalModel properties are used as arguments in to SetupSession in order to preserve the existing settings for those arguments.

Sub ChangeToTelnetTranport()

 With Session

  If .TransportType = rcTelnet Then

   MsgBox "Telnet is the current transport."

  Else

   'SetupSession cannot happen if you are connected

   If .Connected Then .Disconnect

   'Change transport type and use existing values for

   'the other arguments.

   .SetupSession .SessionType, .TerminalModel, rcTelnet

   MsgBox "You are now configured for Telnet transport."

  End If

 End With

End Sub