Reminders Property

Microsoft Outlook Visual Basic

Reminders Property

       

Returns a Reminders collection that represents all current reminders. Read-only.

expression.Reminders

expression   Required. An expression that returns an Application object.

Example

The following example returns the Reminders collection and displays the captions of all reminders in the collection. If there are no current reminders, a message is displayed to the user.

Sub ViewReminderInfo()
'Lists reminder caption information

    Dim olApp As Outlook.Application
    Dim objRem As Reminder
    Dim objRems As Reminders
    Dim strTitle As String
    Dim strReport As String

    Set olApp = Outlook.Application
    Set objRems = olApp.Reminders
    strTitle = "Current Reminders:"
    'If there are reminders, display message
    If olApp.Reminders.Count <> 0 Then
        For Each objRem In objRems
            'If string is empty, create new string
            If strReport = "" Then
                strReport = objRem.Caption & vbCr
            Else
                'Add info to string
                strReport = strReport & objRem.Caption & vbCr
            End If
        Next objRem
        'Display report in dialog
        MsgBox strTitle & vbCr & vbCr & strReport
    Else
        MsgBox "There are no reminders in the collection."

    End If

End Sub