Normal Topic Using Automatic Phone Dialer (Read 5281 times)
Bharat_Naik
Senior Member
Members
*****
Offline


Ever ready to learn and
share

Posts: 1202
Location: Chicago,  Illinois
Joined: Dec 16th, 2003
Using Automatic Phone Dialer
Mar 15th, 2005 at 9:27pm
Print Post Print Post  
You have to download free dialing free utility from following site. It is one very small file named dial.exe

http://www.pcplus.co.uk/tips/default.asp?pagetypeid=2&articleid=5545&subsectioni...

As such the above utilizes dialer.exe that comes with the operating system.

If you have just one Phone element in the form then the following code can be place in Command Button on Element Entry Event

Code
Select All
var VSuccess as Int
var vPhonenumber as String = Phone1    //phone element name
var vAreacode as string = "773"   //Area code
var vName as String = Name    //if firstname and last name change accordingly
var vPath as String = "C:\utilities\"  //path for dial.exe utility


vPhonenumber = @num (vPhonenumber)

If @len (vPhonenumber) = 10 then
      {
            If @left (vPhonenumber, 3) = vAreacode then
            {      
                  vPhonenumber = @Right (vPhonenumber, 7)
            }
            Else
            {
                  vphonenumber = 1 + vPhonenumber
            }
      }

vsuccess = @Shell(@Chr(34) + vPath + "dial.exe" + @Chr(34) + " " + vPhonenumber  + " [" + vName +"]")  

If not vSuccess = 0 then
      {
            @msgbox ("Problem!!! Dialer did not work.", "", "")

      }

 




If you want to use the code for multiple phone elements in a form, you will have to make choice as to put a small button by each phone element or use one single button to dial all different numbers. In both the scenario, you will be better off having a subroutine procedure placed in the Global Code and call that subroutine as needed.
===========
Global Code:

var vPhoneNumber as string

Subroutine DialPhone ( )

var VSuccess as Int
var vAreacode as string = "773"   //Area code
var vName as String = Name    //if firstname and last name separate change accordingly
var vPath as String = "C:\sesame\Utilities\"  //path for dial.exe utility


vPhonenumber = @num (vPhonenumber)

If @len (vPhonenumber) = 10 then
     {
           If @left (vPhonenumber, 3) = vAreacode then
           {      
                 vPhonenumber = @Right (vPhonenumber, 7)
           }
           Else
           {
                 vphonenumber = 1 + vPhonenumber
           }
     }

vsuccess = @Shell(@Chr(34) + vPath + "dial.exe" + @Chr(34) + " " + vPhonenumber  + " [" + vName +"]")

If not vSuccess = 0 then
     {
           @msgbox ("Problem!!! Dialer did not work.", "", "")

     }

End Subroutine

================

Command Buttons on Element Entry Event

DialPhone ( )

==============

If you decide to have just one Button Dial multiple phone numbers on the form, you will have to place the following code on Element Entry Event

vPhoneNumber = ThisElement

================

Place the cursor on the phone number you want to dial and just press the command button, it will dial that particular phone.  If the cursor is not on any phone element, in that case it will dial the number on which the cursor was last.

---------------------------------------------------

The above code will also display the name of the person you are calling. It will also remove the various format element like (    ) -     - from the phone# and add 1 in the begining if it is required. If you are calling locally, it will dial only seven digits as required.  
 



  
Back to top
 
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: I have qa4
Reply #1 - May 13th, 2008 at 3:59pm
Print Post Print Post  
Off topic replies have been moved to This Thread
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged