Äåêëàðèðóåì:
Declare Function tapiRequestMakeCall Lib "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 tapiDialNumber(PhoneNumber)
Dim Msg As String
Dim MsgBoxType As Integer
Dim RetVal As Long
RetVal = tapiRequestMakeCall(PhoneNumber, "", "", "")
If RetVal < 0 Then
Msg = "Unable to dial number " & PhoneNumber
GoTo Err_tapiDialNumber
End If
Exit Sub
Err_tapiDialNumber:
Msg = Msg & vbCr & vbCr & "Ñêîðåé âñåãî äðóãîå óñòðîéñòâî óæå èñïîëüçóåò COM ïîðò"
MsgBoxType = MB_ICONSTOP
MsgBox Msg, MsgBoxType, "Îøèáêà íàáîðà íîìåðà"
End Sub