Create a global module. Add this to the declarations statement:
Declare Function tapiRequestMakeCall Lib "tapi32.dll" (ByVal stNumber As String, ByVal stCalledParty As String, ByVal stAppName As String, ByVal stComment As String) As Long
Add a function:
Public Function DialNumber(PhoneNumber, CalledParty)
'For TAPI dialler. RetVal is 0 if OK. Returns negative numbers if there is a problem.
Dim RetVal As Long
RetVal = tapiRequestMakeCall(PhoneNumber, "", CalledParty, ""
If RetVal < 0 Then
MsgBox "Unable to Dial Number " & PhoneNumber, vbCritical, "Dialer Error"
GoTo Err_DialNumber
End If
Exit Function
Err_DialNumber:
MsgBox "Auto Dial Error - Check Phone Dialer Status", vbExclamation, "Command Button Error"
'MsgBox Err.Description
Call the function from a button, passing the phone number and a reference ie
Button1_click
DialNumber(myphone,mycontactname)
end sub
If your windows dialler is not running, it will start.