You will need to add the Microsoft Communications Control to your form - find it in Tools -> Controls -> ActiveX controls.
The following code will need modifiying to suit your application, and can be used in the [color blue].Click()[/color] event of a commandbutton.
It assumes a modem on com port 2, and the reference to the port will need to be changed in the code for a port other than 2.
It also assumes a table containing the phone no, and if you need to dial a number to obtain an outside line, an example of the necessary code is also included.
Once the connection is made, the user has control of the phone line, and the program terminates.
[color blue]
WITH THISFORM.oleControl1
[tab].Enabled = .T.
[tab].sThreshold = 1
[tab].rThreshold = 1
[tab].CommPort = 2
[tab].PortOpen = .T.
[tab]WAIT WINDOW ;
[tab][tab][Please press the handsfree button on the phone] ;
[tab][tab]+ CHR(13) ;
[tab][tab]+ [and then lift the receiver when the bell sounds.] ;
[tab][tab]TIMEOUT 5
[tab]SET BELL TO [sounds\ringin.WAV], 0
[tab]?? CHR(7)
[tab]SET BELL TO
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.