In the following example, a Telnet connection is configured. An input box is used to prompt for the host name.

Sub TelnetConnection

Dim whatHost As String


With Session

If .Connected = True Then

MsgBox("You already have an open connection.")


.ConnectionType = "Telnet"

whatHost = InputBox$("Host to connect to:", "Host Name")

If whatHost <> "" Then

.ConnectionSettings = "host " & whatHost


End If

End If

End With

End Sub