Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Calendar
  New Posts New Posts RSS Feed - RecurrencePatterns
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

RecurrencePatterns

 Post Reply Post Reply
Author
Message
xmastree View Drop Down
Newbie
Newbie


Joined: 08 November 2005
Status: Offline
Points: 14
Post Options Post Options   Thanks (0) Thanks(0)   Quote xmastree Quote  Post ReplyReply Direct Link To This Post Topic: RecurrencePatterns
    Posted: 17 November 2005 at 4:04pm

Hi,

I am creating events with Recurrences, for example I have set the recurrence

to daily, this populates then entire calendar as required, I now want to remove all the recurring events. I use the remove recurrence on the event but  this does not remove all the recurring events. How do I remove all recurrences, I have checked for recurrencetype  = master but all the events still remain.

Can you please post  code snippet on how to remove All Recurrences in one delete.

Cheers in Advance

Back to Top
sserge View Drop Down
Moderator Group
Moderator Group


Joined: 01 December 2004
Status: Offline
Points: 1297
Post Options Post Options   Thanks (0) Thanks(0)   Quote sserge Quote  Post ReplyReply Direct Link To This Post Posted: 18 November 2005 at 9:53am
Hi,

The example below is included with the next release.


Private Sub mnuDeleteEvent_Click()
    Dim bDeleted As Boolean
    bDeleted = False
    
    If ContextEvent.RecurrenceState = xtpCalendarRecurrenceOccurrence _
        Or ContextEvent.RecurrenceState = xtpCalendarRecurrenceException _
    Then
        frmOccurrenceSeriesChooser.m_bOcurrence = True
        frmOccurrenceSeriesChooser.m_bDeleteRequest = True
        frmOccurrenceSeriesChooser.m_strEventSubject = ContextEvent.Subject
       
        frmOccurrenceSeriesChooser.Show vbModal
       
        If frmOccurrenceSeriesChooser.m_bOK = False Then
             Exit Sub
        ElseIf Not frmOccurrenceSeriesChooser.m_bOcurrence Then
             ' Series
             CalendarControl.DataProvider.DeleteEvent ContextEvent.RecurrencePattern.MasterEvent
             bDeleted = True
        End If
    End If
       
    If Not bDeleted Then
        CalendarControl.DataProvider.DeleteEvent ContextEvent
    End If
    
    CalendarControl.Populate
    CalendarControl.RedrawControl
End Sub


--
HTH,
Serge
Back to Top
xmastree View Drop Down
Newbie
Newbie


Joined: 08 November 2005
Status: Offline
Points: 14
Post Options Post Options   Thanks (0) Thanks(0)   Quote xmastree Quote  Post ReplyReply Direct Link To This Post Posted: 18 November 2005 at 10:08am

Hi,

Thank you a very helpful example.

also I came across removeRecurrence this sets the recurrencetype to 0 and accorsing to the help notes this is now a non recurring event but when I update the event it still belongs to the recurrence series.

should it not be a standalone event at this point. as when I delete the series, this modified event which has no recurrence attached is also deleted can you  help explain why the calendar still thinks it is part of a recurrence

Cheers in Advance

Back to Top
sserge View Drop Down
Moderator Group
Moderator Group


Joined: 01 December 2004
Status: Offline
Points: 1297
Post Options Post Options   Thanks (0) Thanks(0)   Quote sserge Quote  Post ReplyReply Direct Link To This Post Posted: 19 November 2005 at 4:56am
Hi,

The property CalendarRecurrencePattern.MasterEvent returns a new object each time when called.

CalendarEvent.RecurrencePattern also returns new object each time for non-master event. For master event it returns the same internally associated pattern object.

So, the following code will take no effect:
pEvent.RecurrencePattern.MasterEvent.RemoveRecurrence


The example below should work correctly:

Public pMasterEvent As CalendarEvent

Set pMasterEvent = pEvent.RecurrencePattern.MasterEvent
pMasterEvent.RemoveRecurrence

CalendarControl.DataProvider.ChangeEvent pMasterEvent

CalendarControl.Populate
CalendarControl.RedrawControl


--
WBR,
Serge
Back to Top
xmastree View Drop Down
Newbie
Newbie


Joined: 08 November 2005
Status: Offline
Points: 14
Post Options Post Options   Thanks (0) Thanks(0)   Quote xmastree Quote  Post ReplyReply Direct Link To This Post Posted: 19 November 2005 at 1:50pm

Hi,

Thanks for the code

Cheers

Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.156 seconds.