Code: Select all
'REM This line calls the macro subroutine
Dim A1, oShell, retCode, strSoundFile, objShell, strCommand
subSub1_
Sub subSub1_()
If MsgBox("An Alarm will be triggered when [NEW] or [ST] call are created within the Queue!", vbOKCancel, _
" The Queue will be monitored for new call") = vbCancel Then Exit Sub
'Once logged in and at the local queue, with all service call listed.....
Do While autECLSession.autECLPS.GetText(5, 26, 3) <> "NEW" And _
autECLSession.autECLPS.GetText(5, 26, 2) <> "ST" And _
autECLSession.autECLPS.GetText(6, 26, 3) <> "NEW" And _
autECLSession.autECLPS.GetText(6, 26, 2) <> "ST"
autECLSession.autECLOIA.WaitForAppAvailable
autECLSession.autECLOIA.WaitForInputReady
autECLSession.autECLPS.SendKeys "ci", 22, 8
autECLSession.autECLOIA.WaitForInputReady
autECLSession.autECLPS.SendKeys "[enter]"
autECLSession.autECLPS.Wait 5000 ' = 5 seconds - Adjust as required in miliseconds
Loop
strSoundFile = "C:\windows\Media\ringin.wav"
strCommand = "sndrec32 /play /close " & Chr(34) & strSoundFile & Chr(34)
Set objShell = CreateObject("WScript.Shell")
Do
objShell.Run strCommand, 0, False
autECLSession.autECLPS.Wait 500 ' = 0.5 seconds - Adjust as required in miliseconds
If objShell.Popup("New Call Found", 5, " ***WARNING***", &H1 + &H30 + &H1000) = &H2 Then Exit Sub
Loop
End Sub