1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
| DialString = "ATDT" + dialnumber + ";" + vbCr
' Communications port settings.
With MSComm1
.Handshaking = 2 - comRTS
.RThreshold = 1
.RTSEnable = True
.Settings = "9600,N,8,1"
.SThreshold = 1
.CommPort = 3
.InputLen = 0
End With
RingCount = 0
On Error Resume Next
' Ouvrir le port s'il est fermé
If (MSComm1.PortOpen = False) Then
MSComm1.PortOpen = True
End If
If Err Then
MsgBox "COM" & comPort & " n'est pas disponible. Changer la propriété à un autre port."
Exit Sub
End If
' Flush the input buffer.
MSComm1.InBufferCount = 0
' Dial the number.
Application.StatusBar = "Appel en cours du " & dialnumber & " § " & "Transmetteur : " & prom & " § " & Now
MSComm1.Output = DialString
' Mode programmation
If Application.Wait(Now + TimeValue("0:00:20")) Then
Application.StatusBar = "Transmetteur :" & prom & " - " & " Programmation" & " § " & Now
MSComm1.Output = "ATDT *#*" + Chr(13)
End If
' Raccrocher
' Disconnect the modem.
MSComm1.Output = "ATH" + vbCr
' Close the port.
MSComm1.PortOpen = False
End Sub |
Partager