Reminder Event Example

This Microsoft Visual Basic/Visual Basic for Applications example tests the item generating the reminder to determine if it is a mail item. If it is, the example uses the ReplyAll method to create and display a new mail item. The sample code must be placed in a class module, and the Initialize_handler routine must be called before the event procedure can be called by Microsoft Outlook.

Dim WithEvents myolapp As Outlook.Application

Sub Initialize_handler()
    Set myolapp = CreateObject("Outlook.application")
End Sub

Private Sub myolapp_Reminder(ByVal Item As Object)
    Dim myReplyItem As Outlook.MailItem
    If TypeName(Item) = "MailItem" Then
        Set myReplyItem = Item.ReplyAll
        myReplyItem.Display
    End If
End Sub