Public Sub DialNumber(strNumber As String, strLocation As String)
Dim strBuff As String
Dim lngResult As Long
lngResult = tapiRequestMakeCall&(strNumber, CStr(Caption), strLocation, "")
If lngResult <> 0 Then
strBuff = "Error dialing number : "
Select Case lngResult
Case TAPIERR_NOREQUESTRECIPIENT
strBuff = strBuff & "No Windows Telephony dialing application is running and none could be started."
Case TAPIERR_REQUESTQUEUEFULL
strBuff = strBuff & "The queue of pending Windows Telephony dialing requests is full."
Case TAPIERR_INVALDESTADDRESS
strBuff = strBuff & "The phone number is not valid."
Case Else
strBuff = strBuff & "Unknown error."
End Select
MsgBox strBuff
End If
End Sub