Home » Questions » Computers [ Ask a new question ]

Generate an alert in Outlook if I don't receive an email

Generate an alert in Outlook if I don't receive an email

Everyday I have to receive an email xyz.

Asked by: Guest | Views: 310
Total answers/comments: 1
Guest [Entry]

"I think this should answer the question - I was looking for something similar, as I receive a lot of emails in my work from processes that run at specific times, and was looking for a way to keep track of anything that did not come to my inbox when supposed to.

Receive a Reminder When a Message Doesn't Arrive? (writen by Diane Poremsky)

Basically, it details on how to set a ""run a script"" rule that triggers a reminder when you don't get an email within a specified schedule.

The VB code to achieve this is the following:

Sub RemindNewMessages(Item As Outlook.MailItem)

Dim objInbox As Outlook.MAPIFolder
Dim intCount As Integer
Dim objVariant As Variant

Set objInbox = Session.GetDefaultFolder(olFolderInbox)

' Set the flag/reminder on newly arrived message
With Item
.MarkAsTask olMarkThisWeek
.TaskDueDate = Now + 1
.ReminderSet = True
' Reminder in one hour
.ReminderTime = Now + 0.041
.Categories = ""Remind in 1 Hour""
.Save
End With

Item.Save

' look for existing messages and remove the flag and reminder
For intCount = objInbox.Items.Count To 1 Step -1
Set objVariant = objInbox.Items.Item(intCount)

If objVariant.MessageClass = ""IPM.Note"" Then
If LCase(objVariant.Subject) = LCase(Item.Subject) And objVariant.SentOn < Item.SentOn Then
' clear flag and category
With objVariant
.ClearTaskFlag
.Categories = """"
.Save
End With

'or just delete the older messages
' objVariant.Delete
Else
End If
End If
Next

Set objInbox = Nothing
End Sub"