程式碼
--------------------------
Private Sub Command1_Click()
If MSComm1.PortOpen = True Then
MSComm1.PortOpen = False
End If
MSComm1.Settings = "9600,N,8,1" 'COM Port Setting
MSComm1.CommPort = Combo1.Text 'Set Port Number
MSComm1.PortOpen = True 'Open com port
Text1.Text = "通訊埠已開啟"
End Sub
---------------------------