Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

TAPI Call button in MS Access 97, 2k or 2k2

Status
Not open for further replies.

kompupro

IS-IT--Management
Jul 10, 2002
24
NL
Does anyone have a demonstration Access database for making outbound calls [call button] if you use the built in dialer in access it just calls the phone-dialer program.

Thanks in advance [thumbsup2]

Kurt
 

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 &quot;Unable to Dial Number &quot; & PhoneNumber, vbCritical, &quot;Dialer Error&quot;
GoTo Err_DialNumber
End If

Exit Function

Err_DialNumber:

MsgBox &quot;Auto Dial Error - Check Phone Dialer Status&quot;, vbExclamation, &quot;Command Button Error&quot;
'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.


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top