Dial number in Text Box w/o Prompt

R

Rod

Any idea how I can have the following not prompt me for a number and dial
whatever is DIAL_NUMBER (which is a phone number stored as text)?

Private Sub Dial_Number_Click()
On Error GoTo Err_Dial_Number_Click

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

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", DIALNUMBER
'stDialStr

Exit_Dial_Number_Click:
Exit Sub

Err_Dial_Number_Click:
If (Err = ERR_OBJNOTEXIST) Or (Err = ERR_OBJNOTSET) Or (Err =
ERR_CANTMOVE) Then
Resume Next
End If
MsgBox Err.Description
Resume Exit_Dial_Number_Click

End Sub

My gut feeling is a lot of this can be removed.
 
R

Rod

No. At this point, I have figured out how to give the dialer the number.
All I need it to do now is to stop prompting for confirmation of the number.
It pops up with the number in the input field so the user has to press OK.
 

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