Reminder 对象

         
Reminders
Reminder
NameSpace

代表 Microsoft Outlook 提醒。提醒通过在指定时间弹出对话框,使用户清楚将要到来的约会。除了约会,提醒还可以提醒任务、联系人和电子邮件。

使用 Reminder 对象

使用 Reminders(index) 返回单个 Reminder 对象,其中 index 为提醒的名称或索引号。以下示例显示集合中第一个提醒的标题。

Sub ViewReminderInfo()
'Displays information about first reminder in collection

    Dim olApp As Outlook.Application
    Dim objRem As Reminder

    Set olApp = Outlook.Application
    'If there are reminders, display message
    If olApp.Reminders.Count <> 0 Then
        Set objRem = olApp.Reminders.Item(1)
        MsgBox "The caption of the first reminder in the collection is: " & _
               objRem.Caption
    Else
        MsgBox "There are no reminders in the collection."

    End If

End Sub

当创建了新的 Microsoft Outlook 项目(如 AppointmentItem 对象)并且 ReminderSet 属性设置为 True 时,提醒就会由程序创建。使用项目的 ReminderTime 属性设置提醒出现的时间(以分钟计)。以下示例创建新的会议并将 ReminderSet 属性设置为 True,同时将新的 Reminder 对象添加到 Reminders 集合。

Sub AddMeeting()
'Adds a new meeting and reminder to the reminders collection

    Dim olApp As Outlook.Application
    Dim objMeet As AppointmentItem

    Set olApp = Outlook.Application
    Set objMeet = olApp.CreateItem(olAppointmentItem)

    objMeet.ReminderSet = True
    objMeet.Subject = "Tuesday's meeting"

End Sub

使用 Reminders 集合的 Remove 方法从集合中删除 Reminder 对象。一旦提醒从其关联的项目中删除,AppointmentItem 对象的 ReminderSet 属性就设置为 False