Dismiss Outlook reminder

后端 未结 2 2085
时光说笑
时光说笑 2021-01-05 00:03

I am having no luck dismissing an Outlook alert programmatically before it displays.

Private Sub Application_Reminder(ByVal Item As Object)
    Dim objRem As         


        
相关标签:
2条回答
  • 2021-01-05 00:29

    The only way I know how to do this is as follows.

    You need this at the top of your module/class:

    Private WithEvents olRemind As Outlook.Reminders
    

    Then when you get your Outlook object you need to do this:

    Set olRemind = olApp.Reminders
    

    Where olApp is your Outlook Application object.

    Now in your code you need to have this event:

    Private Sub olRemind_BeforeReminderShow(Cancel As Boolean)
    

    Once you put the WithEvents at the top then you will be able to see all the events you can use.

    Now you can cancel this event and thus not see the reminder window.

    0 讨论(0)
  • 2021-01-05 00:44

    If you want to dismiss all the reminders, you can simply implement the following code (declare this object WithEvents displaying all the events):

    Private WithEvents olRemind As Outlook.Reminders
    
    Private Sub Application_Reminder(ByVal Item As Object)
        Set olRemind = Outlook.Reminders
        ' RUN OTHER MACRO HERE
    End Sub
    
    Private Sub olRemind_BeforeReminderShow(Cancel As Boolean)
        Cancel = True          
    End Sub
    
    0 讨论(0)
提交回复
热议问题