none
Outlook 2010 recurring appointment problem need to restart Outlook RRS feed

  • Question

  • Hi,

    I have problem when creating a new recurring appointment which is a Meeting

    In outlook 2010,

    It seems that after I change one of the appointmentItem of the recurring appointment

    Outlook doesn’t recognize that there is a new exception.and it is only happens if the appointment is a meeting.

    I Handling the calendar ItemChange event.

    Using IMAP account for gmail. Items are saved in the item sent folder of this computer.

    However when I restart outlook everything work fine meaning that if I move

    An appointmentItem (meeting) it shows me that a new exception created..

    Can someone please help on the subject?

     This is my code: (simple)

    Patric

     Public Sub ChangedAppointment1(ByVal Item As Object) Handles CalendarItemEvent.ItemChange
            Dim obj As Outlook.AppointmentItem = Nothing
            If TypeOf Item Is Outlook.AppointmentItem Then
                obj = DirectCast(Item, Outlook.AppointmentItem)
                If obj.IsRecurring Then
                    Dim MyPatern As Outlook.RecurrencePattern = obj.GetRecurrencePattern
                    Dim Exceptions As Outlook.Exceptions = MyPatern.Exceptions
                    Connect.ReleaseComObjectLoop(MyPatern)
                    MyPatern = Nothing
                    Dim Ecount As Integer = Exceptions.Count
                    MessageBox.Show(Ecount.ToString)
                    Connect.ReleaseComObjectLoop(Exceptions)
                    Exceptions = Nothing
                End If
            End If
            Connect.ReleaseComObject(obj)
            Connect.ReleaseComObject(Item)
            obj = Nothing
            Item = Nothing
        End Sub


    • Edited by Patrick12_3 Monday, October 15, 2012 6:13 PM
    Monday, October 15, 2012 6:03 PM

Answers

  • Hi ,

    Is it an addin project? It seems that it's not a vba macro.

    Hope some mvps could help with this.

    Regards,

    • Marked as answer by Patrick12_3 Wednesday, December 19, 2012 9:50 PM
    Thursday, October 18, 2012 8:28 AM

All replies

  •  Public Shared Sub ReleaseComObjectLoop(ByVal obj As Object)
            Try
                If obj Is Nothing Then
                    Return
                End If
                Dim i As Integer = 1
                Do While i > 0
                    i = System.Runtime.InteropServices.Marshal.ReleaseComObject(obj)
                Loop
            Catch ex As Exception
               
            Finally
                obj = Nothing
            End Try
        End Sub
        Public Shared Sub ReleaseComObject(ByVal obj As Object)
            Try
                If obj Is Nothing Then
                    Return
                End If
                System.Runtime.InteropServices.Marshal.ReleaseComObject(obj)
            Catch ex As Exception
                
            Finally
                obj = Nothing
            End Try
        End Sub

    Monday, October 15, 2012 6:05 PM
  • Hi ,

    Is it an addin project? It seems that it's not a vba macro.

    Hope some mvps could help with this.

    Regards,

    • Marked as answer by Patrick12_3 Wednesday, December 19, 2012 9:50 PM
    Thursday, October 18, 2012 8:28 AM