Phone Dialer

  • Thread starter Charles L. Phillips
  • Start date
C

Charles L. Phillips

Hello,
I created a button that starts "Phone Dialer"
User highlights the telephone number, then presses the button.
How do I modify the code below to close "Phone Dialer", when a User is done.

This is my current code:

Private Sub Dialer_Click()
On Error GoTo Err_Dialer_Click

Dim stDialStr As String
Dim PrevCtl As Control
Const ERR_OBJNOTEXIST = 2467
Const ERR_OBJNOTSET = 91

Set PrevCtl = Screen.PreviousControl

If TypeOf PrevCtl Is TextBox Then
stDialStr = IIf(VarType(PrevCtl) > V_NULL, PrevCtl, "")
ElseIf TypeOf PrevCtl Is ListBox Then
stDialStr = IIf(VarType(PrevCtl) > V_NULL, PrevCtl, "")
ElseIf TypeOf PrevCtl Is ComboBox Then
stDialStr = IIf(VarType(PrevCtl) > V_NULL, PrevCtl, "")
Else
stDialStr = ""
End If

Application.Run "utility.wlib_AutoDial", stDialStr

Exit_Dialer_Click:
Exit Sub

Err_Dialer_Click:
If (Err = ERR_OBJNOTEXIST) Or (Err = ERR_OBJNOTSET) Then
Resume Next
End If
MsgBox Err.Description
Resume Exit_Dialer_Click
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top