Private Sub cmdDial_Click()
Dim buff As String
Dim nResult As Long
'Invoke tapiRequestMakeCall. If tapiRequestMakeCall=20
returns 0, the
'request has been accepted. It is up to the call=20
manager application
'to do any further work. The second-to-last argument=20
should be
'changed to be the name of the person you are dialing.
nResult =3D tapiRequestMakeCall&(Trim$(txtNumber), CStr
(Caption), "Test", "Comment")
'Display message if error
If nResult <> 0 Then
buff =3D "Error dialing number : "
Select Case nResult
Case TAPIERR_NOREQUESTRECIPIENT
buff =3D buff & "No Windows Telephony=20
dialing application is running and none could be started."
Case TAPIERR_REQUESTQUEUEFULL
buff =3D buff & "The queue of pending=20
Windows Telephony dialing requests is full."
Case TAPIERR_INVALDESTADDRESS
buff =3D buff & "The phone number is not=20
valid."
Case Else
buff =3D buff & "Unknown error."
End Select
MsgBox buff
End If
End Sub
Private Sub cmdExit_Click()
Unload Me
End Sub
Private Sub EnableDial()
cmdDial.Enabled =3D Len(Trim$(txtNumber)) > 0
End Sub
--------------------------------------------------------
Cette action est irreversible, confirmez la suppression du commentaire ?
Signaler le commentaire
Veuillez sélectionner un problème
Nudité
Violence
Harcèlement
Fraude
Vente illégale
Discours haineux
Terrorisme
Autre
ng
Salut,
Pas d'accès au APIs Windows ni DLLs classique en VBS, seulement du COM (CreateObject()). Il faudra wrapper ta fonction dans une DLL COM ou procéder autrement.
-- Nicolas G. FAQ VB : http://faq.vb.free.fr API Guide : http://www.allapi.net Google Groups : http://groups.google.fr/ MZ-Tools : http://www.mztools.com/ http://apisvb.europe.webmatrixhosting.net/
Je souhaiterai passer ce code en VBScript : -------------------------------------------------------- Option Explicit
Private Sub cmdDial_Click() Dim buff As String Dim nResult As Long
'Invoke tapiRequestMakeCall. If tapiRequestMakeCall returns 0, the 'request has been accepted. It is up to the call manager application 'to do any further work. The second-to-last argument should be 'changed to be the name of the person you are dialing. nResult = tapiRequestMakeCall&(Trim$(txtNumber), CStr (Caption), "Test", "Comment") 'Display message if error If nResult <> 0 Then buff = "Error dialing number : " Select Case nResult Case TAPIERR_NOREQUESTRECIPIENT buff = buff & "No Windows Telephony dialing application is running and none could be started." Case TAPIERR_REQUESTQUEUEFULL buff = buff & "The queue of pending Windows Telephony dialing requests is full." Case TAPIERR_INVALDESTADDRESS buff = buff & "The phone number is not valid." Case Else buff = buff & "Unknown error." End Select MsgBox buff End If End Sub
Private Sub cmdExit_Click() Unload Me End Sub
Private Sub EnableDial() cmdDial.Enabled = Len(Trim$(txtNumber)) > 0 End Sub --------------------------------------------------------
msgbox "test" tapiRequestMakeCall&("192.168.0.108", "VBScript autodial", "Nom du destinataire", "Appel réalisé d'un script VB") WScript.Quit
Mais ça ne fonctionne pas...
Salut,
Pas d'accès au APIs Windows ni DLLs classique en VBS, seulement du COM
(CreateObject()). Il faudra wrapper ta fonction dans une DLL COM ou procéder
autrement.
--
Nicolas G.
FAQ VB : http://faq.vb.free.fr
API Guide : http://www.allapi.net
Google Groups : http://groups.google.fr/
MZ-Tools : http://www.mztools.com/
http://apisvb.europe.webmatrixhosting.net/
Je souhaiterai passer ce code en VBScript :
--------------------------------------------------------
Option Explicit
Private Sub cmdDial_Click()
Dim buff As String
Dim nResult As Long
'Invoke tapiRequestMakeCall. If tapiRequestMakeCall
returns 0, the
'request has been accepted. It is up to the call
manager application
'to do any further work. The second-to-last argument
should be
'changed to be the name of the person you are dialing.
nResult = tapiRequestMakeCall&(Trim$(txtNumber), CStr
(Caption), "Test", "Comment")
'Display message if error
If nResult <> 0 Then
buff = "Error dialing number : "
Select Case nResult
Case TAPIERR_NOREQUESTRECIPIENT
buff = buff & "No Windows Telephony
dialing application is running and none could be started."
Case TAPIERR_REQUESTQUEUEFULL
buff = buff & "The queue of pending
Windows Telephony dialing requests is full."
Case TAPIERR_INVALDESTADDRESS
buff = buff & "The phone number is not
valid."
Case Else
buff = buff & "Unknown error."
End Select
MsgBox buff
End If
End Sub
Private Sub cmdExit_Click()
Unload Me
End Sub
Private Sub EnableDial()
cmdDial.Enabled = Len(Trim$(txtNumber)) > 0
End Sub
--------------------------------------------------------
Pas d'accès au APIs Windows ni DLLs classique en VBS, seulement du COM (CreateObject()). Il faudra wrapper ta fonction dans une DLL COM ou procéder autrement.
-- Nicolas G. FAQ VB : http://faq.vb.free.fr API Guide : http://www.allapi.net Google Groups : http://groups.google.fr/ MZ-Tools : http://www.mztools.com/ http://apisvb.europe.webmatrixhosting.net/
Je souhaiterai passer ce code en VBScript : -------------------------------------------------------- Option Explicit
Private Sub cmdDial_Click() Dim buff As String Dim nResult As Long
'Invoke tapiRequestMakeCall. If tapiRequestMakeCall returns 0, the 'request has been accepted. It is up to the call manager application 'to do any further work. The second-to-last argument should be 'changed to be the name of the person you are dialing. nResult = tapiRequestMakeCall&(Trim$(txtNumber), CStr (Caption), "Test", "Comment") 'Display message if error If nResult <> 0 Then buff = "Error dialing number : " Select Case nResult Case TAPIERR_NOREQUESTRECIPIENT buff = buff & "No Windows Telephony dialing application is running and none could be started." Case TAPIERR_REQUESTQUEUEFULL buff = buff & "The queue of pending Windows Telephony dialing requests is full." Case TAPIERR_INVALDESTADDRESS buff = buff & "The phone number is not valid." Case Else buff = buff & "Unknown error." End Select MsgBox buff End If End Sub
Private Sub cmdExit_Click() Unload Me End Sub
Private Sub EnableDial() cmdDial.Enabled = Len(Trim$(txtNumber)) > 0 End Sub --------------------------------------------------------