Every alarm action (receive/clear/acknowledge) executes an event available for VB(A). The object must be defined WithEvents.

[highlight=vb]Dim WithEvents zAlarm As Alarm

'procedure is executed on startup of the zenOn runtime
Private Sub Project_Active()
'init the alarm object for events
Set zAlarm = thisProject.Alarm
End Sub

'procedure is executed when an Alarm comes
Private Sub zAlarm_AlarmComes(ByVal obItem As IAlarmItem)
'print specific information to Debug window...
Debug.Print obItem.Timecomes & " > " & obItem.Text
End Sub

'procedure is executed when an Alarm has gone
Private Sub zAlarm_AlarmGoes(ByVal obItem As IAlarmItem)
'print specific information to Debug window...
Debug.Print obItem.Timegoes & " < " & obItem.Text
End Sub

'procedure is executed when an Alarm was acknowledged by a user
Private Sub zAlarm_AlarmAcknowledged(ByVal obItem As IAlarmItem)
'print specific information to Debug window...
Debug.Print obItem.TimeAcknowledged & " | " & obItem.Text
End Sub

'procedure is executed on terminating the zenOn Runtime
Private Sub Project_Inactive()
'free the alarm object
Set zAlarm = Nothing
End Sub
[highlight]