Reminders 属性

       

返回代表当前所有提醒的 Reminders 集合。只读。

expression.Reminders

expression  必选。该表达式返回 Application 对象。

示例

以下示例返回 Reminders 集合并显示集合中所有提醒的标题。如果当前没有提醒,就会向用户显示一条消息。

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