junoon
Aug 23rd, 2000, 09:17 AM
dear
i want to integrate a telephone equipment with vb form
i.e as soon as someone rings the phone a form should pop on window
could you do that
junoon
gwdash
Aug 23rd, 2000, 08:24 PM
if you understand the MSComm Control, you could use the OnComm event with the the Ring event. Then you could do that! check MSDN
gfrench
Aug 24th, 2000, 05:02 PM
OK, i will expand a bit on gwDash's comments.
Create a new exe, add the MSCOMM control. On the form, create a label (label1), a ListBox (List1) and last but not least the MSCOMM control (MSCOMM1), then paste the code below into the form code (overwrite any code that already exists in there),
<---Start Of Code--->
Private Sub Form_Load()
MSComm1.CommPort = 1 'Set the comm port of the modem
MSComm1.Settings = "9600,N,8,1" 'Set some modem settings (These will do for this project)
MSComm1.PortOpen = True
End Sub
Private Sub MSComm1_OnComm()
'Check if the event was a ring
If MSComm1.CommEvent = 6 Then
'If it was add 1 to the number of rings recieved by the program (to a label that the user can see)
Label1.Tag = Label1.Tag + 1
Label1.Caption = "Total Number Of Rings: " & Label1.Tag
'Record the time at which the ring was detected
Tim$ = Time$
'Ask the user who called
caller = InputBox("Who called?", "Who Called?", "Company")
'Add the event to a list with the time at which the phone rang
List1.AddItem caller & " rang at " & Tim$
End If
End Sub
<---End of code--->
Hope this has helped
Grant French
E-Mail: grant.french@libertysurf.co.uk
ICQ: 33122184