none
VBA macro to set reminder for recurring appointments RRS feed

  • Question

  • Hi,

    I have this macro to set the reminder to 5m for a selected item in the calendar view. It works great for non-recurring appointments, but it doesn't work at all for recurring appointments. Any suggestions on how to make it work for either case?

    Thanks,

    TWS

    Sub SetReminder()
        
        Dim objOutlook As Outlook.Application
        Dim objInspector As Outlook.Inspector
    
        Dim strDateTime As String
    
        ' Instantiate an Outlook Application object.
        Set objOutlook = CreateObject("Outlook.Application")
    
        ' The ActiveInspector is the currently open item.
        Set objExplorer = objOutlook.ActiveExplorer
    
        ' Check and see if anything is open.
        If Not objExplorer Is Nothing Then
            ' Get the current item.
            Dim arySelection As Object
            Set arySelection = objExplorer.Selection
            
            For x = 1 To arySelection.Count
         '       strCats = arySelection.Item(x).Categories
          '      If Not strCats = "" Then
           '         strCats = strCats & ","
            '    End If
          '     strCats = strCats & "Business"
          '     arySelection.Item(x).Categories = strCats
                arySelection.Item(x).ReminderSet = True
                arySelection.Item(x).ReminderMinutesBeforeStart = 5
                arySelection.Item(x).Save
            Next x
            
        Else
            ' Show error message with only the OK button.
            MsgBox "No explorer is open", vbOKOnly
        End If
    
        ' Set all objects equal to Nothing to destroy them and
        ' release the memory and resources they take.
        Set objOutlook = Nothing
        Set objInspector = Nothing
        Set strDateTime = Nothing
        Set objExplorer = Nothing
    
    End Sub

    Thursday, August 27, 2015 3:59 PM

Answers

  • Hello,

    > but it doesn't work at all for recurring appointments

    You need to get an appointment item from the series and set up properties. Or set up properties before setting the recurrence pattern when creating a series of appointments.

    The ReminderSet property allows to set a boolean value that is true if a reminder has been set for this item. 

    The ReminderOverrideDefault property allows to sets a boolean value that is true if the reminder overrides the default reminder behavior for the item.

    You may use the GetRecurrencePattern method of the AppointmentItem class to get a RecurrencePattern object that represents the recurrence attributes of an appointment. The GetOccurrence method returns a specific instance of the AppointmentItem object on the specified date.



    Thursday, August 27, 2015 4:35 PM

All replies

  • Hello,

    > but it doesn't work at all for recurring appointments

    You need to get an appointment item from the series and set up properties. Or set up properties before setting the recurrence pattern when creating a series of appointments.

    The ReminderSet property allows to set a boolean value that is true if a reminder has been set for this item. 

    The ReminderOverrideDefault property allows to sets a boolean value that is true if the reminder overrides the default reminder behavior for the item.

    You may use the GetRecurrencePattern method of the AppointmentItem class to get a RecurrencePattern object that represents the recurrence attributes of an appointment. The GetOccurrence method returns a specific instance of the AppointmentItem object on the specified date.



    Thursday, August 27, 2015 4:35 PM
  • It still doesn't work for me. 

    The change seems not persistent nor effective (I don't see it when I open the recurring appointment)

    though the object property is set via VBA

    It is really annoying since a lot of reminder may disappear if you update an appointment aftwerwards to postpone it with a reminder removed because it was already overdue.





    • Edited by tdalon Tuesday, April 2, 2019 8:46 AM
    Tuesday, April 2, 2019 8:43 AM