Public email As String
Sub Macro1()
Attribute Macro1.VB_ProcData.VB_Invoke_Func = " \n14"
email = "pinco.pallino@urcaorca.com"
alertTime = Now + TimeValue("00:00:05")
Application.OnTime alertTime, "EventMacro"
End Sub
Function retrieveStatus(user As String) As String
Dim myservice As String
Set communicator = CommunicatorAPI.Messenger
Set contact = communicator.GetContact(user, myservice)
Select Case contact.Status
Case 1
retrieveStatus = "Offline"
Case 2
retrieveStatus = "Online"
Case 10
retrieveStatus = "Busy"
Case "18"
retrieveStatus = "Idle"
Case "34"
retrieveStatus = "Away"
End Select
End Function
Sub EventMacro()
If retrieveStatus(email) = "Away" Then
MsgBox "He is away"
Else
alertTime = Now + TimeValue("00:00:05")
Application.OnTime alertTime, "EventMacro"
End If
End Sub
After you set the email
email = "pinco.pallino@urcaorca.com"
and the interval of the time
TimeValue("00:00:05")
when you are ready you can run the Macro1