SERá COMPLICADO? markaje telefónico.....
Hola, me sugireron un programa en mi trabajo, es el sig: armar una red, desde el servidor tomar un archivo en excel y de allà estar mandando datos a las estaciones de trabajo, uno de los datos es un número telefónico, ke al presionar un botón se marke ese teléfono y puedas atender la llamada. No tengo la más remota idea de cómo se puede hacer esto último, osea, marcar el teléfono. Ké habrÃa ke implementar o usar para lograrlo...ALGUNA SUGERENCIA????? please...
Necesitas el objeto Microsoft Comm Control 6.0 que viene con el visual studio. Hazte una ventanita, con una caja de texto, dos botones y un objeto MSComm y este es el codigo ...
Dim cancelar As Boolean
'Boton para hacer la llamada...
Private Sub Command1_Click()
If Text1.Text = "" Then
MsgBox "Introduzca un número a marcar!", vbCritical, "Marcar"
Else
cancelar = False
Command1.Caption = "Marcando..."
Dial (Text1.Text)
End If
End Sub
'Procedimiento que hace la llamada ...
Private Sub Dial(Number$)
Dim DialString$, FromModem$, dummy
DialString$ = "ATDT" + Number$ + ";" + vbCr
On Error Resume Next
MSComm1.PortOpen = True
If Err Then
MsgBox "Error de Puerto!"
Exit Sub
End If
MSComm1.InBufferCount = 0
MSComm1.Output = DialString$
Do
dummy = DoEvents()
If MSComm1.InBufferCount Then
FromModem$ = FromModem$ + MSComm1.Input
If InStr(FromModem$, "OK") Then
Beep
MsgBox "Por favor alce el auricular y presione Enter o haga click."
Command4.Caption = "Marcar"
Exit Do
End If
End If
If cancelar Then
cancelar = False
Exit Do
End If
Loop
MSComm1.Output = "ATH" + vbCr
MSComm1.PortOpen = False
End Sub
'Boton para cancelar la llamada si se desea ...
Private Sub Command2_Click()
cancelar = True
Command1.Caption = "Marcar"
End Sub
'PAra que ingresen solo numeros ...
Private Sub Text1_KeyPress(KeyAscii As Integer)
Dim c As String
c = Chr(KeyAscii)
Select Case c
Case "0" To "9", Chr(10), Chr(13), Chr(8)
Case Else:
KeyAscii = 0
End Select
End Sub
espero puedas implementarlo a mi me funciono, si tienes alguna duda, escribeme ...
Dim cancelar As Boolean
'Boton para hacer la llamada...
Private Sub Command1_Click()
If Text1.Text = "" Then
MsgBox "Introduzca un número a marcar!", vbCritical, "Marcar"
Else
cancelar = False
Command1.Caption = "Marcando..."
Dial (Text1.Text)
End If
End Sub
'Procedimiento que hace la llamada ...
Private Sub Dial(Number$)
Dim DialString$, FromModem$, dummy
DialString$ = "ATDT" + Number$ + ";" + vbCr
On Error Resume Next
MSComm1.PortOpen = True
If Err Then
MsgBox "Error de Puerto!"
Exit Sub
End If
MSComm1.InBufferCount = 0
MSComm1.Output = DialString$
Do
dummy = DoEvents()
If MSComm1.InBufferCount Then
FromModem$ = FromModem$ + MSComm1.Input
If InStr(FromModem$, "OK") Then
Beep
MsgBox "Por favor alce el auricular y presione Enter o haga click."
Command4.Caption = "Marcar"
Exit Do
End If
End If
If cancelar Then
cancelar = False
Exit Do
End If
Loop
MSComm1.Output = "ATH" + vbCr
MSComm1.PortOpen = False
End Sub
'Boton para cancelar la llamada si se desea ...
Private Sub Command2_Click()
cancelar = True
Command1.Caption = "Marcar"
End Sub
'PAra que ingresen solo numeros ...
Private Sub Text1_KeyPress(KeyAscii As Integer)
Dim c As String
c = Chr(KeyAscii)
Select Case c
Case "0" To "9", Chr(10), Chr(13), Chr(8)
Case Else:
KeyAscii = 0
End Select
End Sub
espero puedas implementarlo a mi me funciono, si tienes alguna duda, escribeme ...
Me olvidaba ... tambien debes agregar esto ..
'Inicializamos el objeto MSComm
Private Sub Form_Load()
MSComm1.InputLen = 0
End Sub
'Inicializamos el objeto MSComm
Private Sub Form_Load()
MSComm1.InputLen = 0
End Sub
