Twitter iPhone pliant OnePlus 11 PS5 Disney+ Orange Livebox Windows 11

Tapi32.dll

4 réponses
Avatar
Fredo P.
Bonjour
J'ai un petit souci avec l'utilisation de Dialer sur XP, il y a beaucoup
trop de friture.
Voici le code pour W98 aimablement rétrocédé par MichDenis, est ce qu'il n'y
en aurait pas un spécifique pour XP?

Declare Function tapiRequestMakeCall Lib "C:\Windows\system\tapi32.dll" _
(ByVal stNumber As String, ByVal stDummy1 As String, _
ByVal stDummy2 As String, ByVal stDummy3 As String) As Long

Public Const ID_CANCEL = 2
Public Const MB_OKCANCEL = 1
Public Const MB_ICONSTOP = 16, MB_ICONINFORMATION = 64

'----------------------------
Sub Dialer()
ColName = 1
ColPhone = 2
'Tu peux utiliser cette procédure et appeler la fonction de cette façon si
tu désires :
'DialNumber "12454556", "Diane"

vRow = Selection.Row - 1
If vRow = 0 Then Exit Sub
DialNumber Range("A1").Offset(vRow, ColPhone - 1).Value, _
Range("A1").Offset(vRow, ColName - 1).Value
End Sub

Sub DialNumber(PhoneNumber, Optional vName As Variant)
Dim Msg As String, MsgBoxType As Integer, MsgBoxTitle As String
Dim RetVal As Long

' Ask the user to pick up the phone.
Msg = "Décrochez le combiné et cliquez OK pour appeler " _
& Chr(13) & Chr(13) & PhoneNumber & " " & vName
MsgBoxType = MB_ICONINFORMATION + MB_OKCANCEL
MsgBoxTitle = "Numéro d'appel"
If MsgBox(Msg, MsgBoxType, MsgBoxTitle) = ID_CANCEL Then
Range("nom") = ""
Cells(1, 1).Select
Exit Sub
End If

' Send the telephone number to the modem.
RetVal = tapiRequestMakeCall(PhoneNumber, "", vName, "")
If RetVal < 0 Then
Msg = "Mauvais numéro d'appel " & PhoneNumber
GoTo Err_DialNumber
End If
Range("nom") = ""
[A2].Select
Exit Sub

Err_DialNumber: 'This is not an On Error routine.
Msg = Msg & Chr(13) & Chr(13) & _
"Contrôler le port d'usage pour Dial.exe"
MsgBoxType = MB_ICONSTOP
MsgBoxTitle = "Erreur d'aiguillage"
MsgBox Msg, MsgBoxType, MsgBoxTitle

End Sub

4 réponses

Avatar
MichDenis
Il existe aussi ceci :

'Déclaration API
Declare Function DialAnyPhoneNumber Lib "tapi32.dll" Alias "tapiRequestMakeCall" ( _
ByVal strPhoneNumber As String, _
ByVal strArg1 As String, _
ByVal strArg2 As String, _
ByVal strArg3 As String) As Long


Sub PlacePhoneCall(strTelephoneNumberToDial As String)
' -----------------------------------------------------------
' Author: Calvin Smith
' Environment(s): MS Access (32-bit) / Visual Basic (32-bit)
' *****************************************
' * Courtesy code from my CodeDisk© product
' *****************************************
' ---------------------------------------------------------
' Purpose: Example of how to place a phone call from VB / VBA code
' Accepts: strTelephoneNumberToDial as the valid phone number
' Returns: Nothing
' Example usage: PlacePhoneCall "1-800-555-5555"
' ----------------------------------------------------------------------------'
On Error GoTo ErrorHandling_Err
DialAnyPhoneNumber strTelephoneNumberToDial$, "", "", ""
ErrorHandling_Exit:
Exit Sub
ErrorHandling_Err:
If Err Then
'Trap your error(s) here, if any!
Resume ErrorHandling_Exit
End If
End Sub
'------------------------------------
Sub Appel()

PlacePhoneCall "7777777777"
End Sub
'------------------------------------



"Fredo P." a écrit dans le message de news:
uRGq%
Bonjour
J'ai un petit souci avec l'utilisation de Dialer sur XP, il y a beaucoup
trop de friture.
Voici le code pour W98 aimablement rétrocédé par MichDenis, est ce qu'il n'y
en aurait pas un spécifique pour XP?

Declare Function tapiRequestMakeCall Lib "C:Windowssystemtapi32.dll" _
(ByVal stNumber As String, ByVal stDummy1 As String, _
ByVal stDummy2 As String, ByVal stDummy3 As String) As Long

Public Const ID_CANCEL = 2
Public Const MB_OKCANCEL = 1
Public Const MB_ICONSTOP = 16, MB_ICONINFORMATION = 64

'----------------------------
Sub Dialer()
ColName = 1
ColPhone = 2
'Tu peux utiliser cette procédure et appeler la fonction de cette façon si
tu désires :
'DialNumber "12454556", "Diane"

vRow = Selection.Row - 1
If vRow = 0 Then Exit Sub
DialNumber Range("A1").Offset(vRow, ColPhone - 1).Value, _
Range("A1").Offset(vRow, ColName - 1).Value
End Sub

Sub DialNumber(PhoneNumber, Optional vName As Variant)
Dim Msg As String, MsgBoxType As Integer, MsgBoxTitle As String
Dim RetVal As Long

' Ask the user to pick up the phone.
Msg = "Décrochez le combiné et cliquez OK pour appeler " _
& Chr(13) & Chr(13) & PhoneNumber & " " & vName
MsgBoxType = MB_ICONINFORMATION + MB_OKCANCEL
MsgBoxTitle = "Numéro d'appel"
If MsgBox(Msg, MsgBoxType, MsgBoxTitle) = ID_CANCEL Then
Range("nom") = ""
Cells(1, 1).Select
Exit Sub
End If

' Send the telephone number to the modem.
RetVal = tapiRequestMakeCall(PhoneNumber, "", vName, "")
If RetVal < 0 Then
Msg = "Mauvais numéro d'appel " & PhoneNumber
GoTo Err_DialNumber
End If
Range("nom") = ""
[A2].Select
Exit Sub

Err_DialNumber: 'This is not an On Error routine.
Msg = Msg & Chr(13) & Chr(13) & _
"Contrôler le port d'usage pour Dial.exe"
MsgBoxType = MB_ICONSTOP
MsgBoxTitle = "Erreur d'aiguillage"
MsgBox Msg, MsgBoxType, MsgBoxTitle

End Sub
Avatar
MichDenis
| Ta date système retarde d'un jour.

Absolument pas, c'est le sommeil que j'ai à rattrapper !
Avatar
Daniel.C
Salut.
Ta date système retarde d'un jour.
Cordialement.
Daniel
"MichDenis" a écrit dans le message de news:
%
Il existe aussi ceci :

'Déclaration API
Declare Function DialAnyPhoneNumber Lib "tapi32.dll" Alias
"tapiRequestMakeCall" ( _
ByVal strPhoneNumber As String, _
ByVal strArg1 As String, _
ByVal strArg2 As String, _
ByVal strArg3 As String) As Long


Sub PlacePhoneCall(strTelephoneNumberToDial As String)
' -----------------------------------------------------------
' Author: Calvin Smith
' Environment(s): MS Access (32-bit) / Visual Basic (32-bit)
' *****************************************
' * Courtesy code from my CodeDisk© product
' *****************************************
' ---------------------------------------------------------
' Purpose: Example of how to place a phone call from VB / VBA code
' Accepts: strTelephoneNumberToDial as the valid phone number
' Returns: Nothing
' Example usage: PlacePhoneCall "1-800-555-5555"
' ----------------------------------------------------------------------------'
On Error GoTo ErrorHandling_Err
DialAnyPhoneNumber strTelephoneNumberToDial$, "", "", ""
ErrorHandling_Exit:
Exit Sub
ErrorHandling_Err:
If Err Then
'Trap your error(s) here, if any!
Resume ErrorHandling_Exit
End If
End Sub
'------------------------------------
Sub Appel()

PlacePhoneCall "7777777777"
End Sub
'------------------------------------



"Fredo P." a écrit dans le
message de news:
uRGq%
Bonjour
J'ai un petit souci avec l'utilisation de Dialer sur XP, il y a beaucoup
trop de friture.
Voici le code pour W98 aimablement rétrocédé par MichDenis, est ce qu'il
n'y
en aurait pas un spécifique pour XP?

Declare Function tapiRequestMakeCall Lib "C:Windowssystemtapi32.dll" _
(ByVal stNumber As String, ByVal stDummy1 As String, _
ByVal stDummy2 As String, ByVal stDummy3 As String) As Long

Public Const ID_CANCEL = 2
Public Const MB_OKCANCEL = 1
Public Const MB_ICONSTOP = 16, MB_ICONINFORMATION = 64

'----------------------------
Sub Dialer()
ColName = 1
ColPhone = 2
'Tu peux utiliser cette procédure et appeler la fonction de cette façon si
tu désires :
'DialNumber "12454556", "Diane"

vRow = Selection.Row - 1
If vRow = 0 Then Exit Sub
DialNumber Range("A1").Offset(vRow, ColPhone - 1).Value, _
Range("A1").Offset(vRow, ColName - 1).Value
End Sub

Sub DialNumber(PhoneNumber, Optional vName As Variant)
Dim Msg As String, MsgBoxType As Integer, MsgBoxTitle As String
Dim RetVal As Long

' Ask the user to pick up the phone.
Msg = "Décrochez le combiné et cliquez OK pour appeler " _
& Chr(13) & Chr(13) & PhoneNumber & " " & vName
MsgBoxType = MB_ICONINFORMATION + MB_OKCANCEL
MsgBoxTitle = "Numéro d'appel"
If MsgBox(Msg, MsgBoxType, MsgBoxTitle) = ID_CANCEL Then
Range("nom") = ""
Cells(1, 1).Select
Exit Sub
End If

' Send the telephone number to the modem.
RetVal = tapiRequestMakeCall(PhoneNumber, "", vName, "")
If RetVal < 0 Then
Msg = "Mauvais numéro d'appel " & PhoneNumber
GoTo Err_DialNumber
End If
Range("nom") = ""
[A2].Select
Exit Sub

Err_DialNumber: 'This is not an On Error routine.
Msg = Msg & Chr(13) & Chr(13) & _
"Contrôler le port d'usage pour Dial.exe"
MsgBoxType = MB_ICONSTOP
MsgBoxTitle = "Erreur d'aiguillage"
MsgBox Msg, MsgBoxType, MsgBoxTitle

End Sub





Avatar
Fredo P.
Merci Denis
Je vais essayer cela après un petit somme d'une heure et non pas une
journée.:o)
"MichDenis" a écrit dans le message de news:
%
Il existe aussi ceci :

'Déclaration API
Declare Function DialAnyPhoneNumber Lib "tapi32.dll" Alias
"tapiRequestMakeCall" ( _
ByVal strPhoneNumber As String, _
ByVal strArg1 As String, _
ByVal strArg2 As String, _
ByVal strArg3 As String) As Long


Sub PlacePhoneCall(strTelephoneNumberToDial As String)
' -----------------------------------------------------------
' Author: Calvin Smith
' Environment(s): MS Access (32-bit) / Visual Basic (32-bit)
' *****************************************
' * Courtesy code from my CodeDisk© product
' *****************************************
' ---------------------------------------------------------
' Purpose: Example of how to place a phone call from VB / VBA code
' Accepts: strTelephoneNumberToDial as the valid phone number
' Returns: Nothing
' Example usage: PlacePhoneCall "1-800-555-5555"
' ----------------------------------------------------------------------------'
On Error GoTo ErrorHandling_Err
DialAnyPhoneNumber strTelephoneNumberToDial$, "", "", ""
ErrorHandling_Exit:
Exit Sub
ErrorHandling_Err:
If Err Then
'Trap your error(s) here, if any!
Resume ErrorHandling_Exit
End If
End Sub
'------------------------------------
Sub Appel()

PlacePhoneCall "7777777777"
End Sub
'------------------------------------



"Fredo P." a écrit dans le
message de news:
uRGq%
Bonjour
J'ai un petit souci avec l'utilisation de Dialer sur XP, il y a beaucoup
trop de friture.
Voici le code pour W98 aimablement rétrocédé par MichDenis, est ce qu'il
n'y
en aurait pas un spécifique pour XP?

Declare Function tapiRequestMakeCall Lib "C:Windowssystemtapi32.dll" _
(ByVal stNumber As String, ByVal stDummy1 As String, _
ByVal stDummy2 As String, ByVal stDummy3 As String) As Long

Public Const ID_CANCEL = 2
Public Const MB_OKCANCEL = 1
Public Const MB_ICONSTOP = 16, MB_ICONINFORMATION = 64

'----------------------------
Sub Dialer()
ColName = 1
ColPhone = 2
'Tu peux utiliser cette procédure et appeler la fonction de cette façon si
tu désires :
'DialNumber "12454556", "Diane"

vRow = Selection.Row - 1
If vRow = 0 Then Exit Sub
DialNumber Range("A1").Offset(vRow, ColPhone - 1).Value, _
Range("A1").Offset(vRow, ColName - 1).Value
End Sub

Sub DialNumber(PhoneNumber, Optional vName As Variant)
Dim Msg As String, MsgBoxType As Integer, MsgBoxTitle As String
Dim RetVal As Long

' Ask the user to pick up the phone.
Msg = "Décrochez le combiné et cliquez OK pour appeler " _
& Chr(13) & Chr(13) & PhoneNumber & " " & vName
MsgBoxType = MB_ICONINFORMATION + MB_OKCANCEL
MsgBoxTitle = "Numéro d'appel"
If MsgBox(Msg, MsgBoxType, MsgBoxTitle) = ID_CANCEL Then
Range("nom") = ""
Cells(1, 1).Select
Exit Sub
End If

' Send the telephone number to the modem.
RetVal = tapiRequestMakeCall(PhoneNumber, "", vName, "")
If RetVal < 0 Then
Msg = "Mauvais numéro d'appel " & PhoneNumber
GoTo Err_DialNumber
End If
Range("nom") = ""
[A2].Select
Exit Sub

Err_DialNumber: 'This is not an On Error routine.
Msg = Msg & Chr(13) & Chr(13) & _
"Contrôler le port d'usage pour Dial.exe"
MsgBoxType = MB_ICONSTOP
MsgBoxTitle = "Erreur d'aiguillage"
MsgBox Msg, MsgBoxType, MsgBoxTitle

End Sub