TryingToLearn
Well-known Member
- Joined
- Sep 10, 2003
- Messages
- 733
I've implemented a phone dialer for this project with code from the board and it works well. The problem is it also opens up the Windows phone dialer. I've attempted to close the dialer with code to no avail. I'm assuming AppActivate doesn't work with 97 which accounts for some of the issues of my code it seems to send the AltF4 to the vb with the return This Command Will Stop The Debugger. If I run the code straight, it doesn't seem to do anything.
Checking on possibilities, I looked at creating an object with dialer but get Active X component can not create
an object (or similar wording).
Any suggestions to close the dialer would be appreciated.
Checking on possibilities, I looked at creating an object with dialer but get Active X component can not create
an object (or similar wording).
Any suggestions to close the dialer would be appreciated.
Code:
'In the Userform:
Option Explicit
Public num, nam As String
Private Sub CommandButton1_Click()
num = TextBox1.Text
nam = CB1_MemName.Text
If Len(num) < 10 Then
MsgBox "Number must be minimum 10 digits", vbCritical, "INVALID NUMBER"
Exit Sub
End If
Call CallBtn(num, nam)
num = Empty
' AppActivate "Phone Dialer"
' Application.SendKeys "%{F4}"
End Sub
'In a module:
Option Explicit
Declare Function tapiRequestMakeCall Lib "TAPI32.DLL" (ByVal lpszDestAddress As String, ByVal lpszAppName As String, ByVal lpszCalledParty As String, ByVal lpszComment As String) As Long
Sub CallBtn(num, nam)
Dim x As Long ' for return
Dim cPhone As String
Dim cName As String
'
cName = nam
cPhone = num
'
x = tapiRequestMakeCall(num, "", cName, "")
End Sub