Mark Event as Exception via Code |
Post Reply |
Author | |
AndyWilton
Groupie Joined: 03 June 2008 Status: Offline Points: 82 |
Post Options
Thanks(0)
Posted: 23 September 2009 at 10:08am |
Hi All, I'm trying to either mark or delete some occurrences of a Recurring Event via some code that is executed by a button press. To be honest, I'm struggling to even mark an event as an exception let alone delete it. I've tried various code combinations - none with success. Some of the things I've tried include:- on the button press after selecting an event - pMasterEvent = ?OLE{'ActiveView.GetSelectedEvents.ViewEvent(0).Event.RecurrencePattern.MasterEvent'} ?OLE{pRecurObj & '.MakeAsRException'} ?OLE{pMasterEvent & '.RecurrencePattern.SetException(' & pRecurObj & ')'} ?OLE{pMasterObj & '.UpdateRecurrence(' & pPatternObj & ')'} ?OLE{'Populate'} OR on the SelectedChanged event when a Calendar Event has been selected - pMasterObj = OLEControlFEQ{'ActiveView.HitTest.ViewEvent.Event.RecurrencePattern.MasterEvent'} OLEControlFEQ{pPatternObj & '.Exceptions.SetException.Add(' & OLEControlFEQ{'ActiveView.HitTest.ViewEvent.Event'} & ')'} OLEControlFEQ{pMasterObj & '.UpdateRecurrence(' & pPatternObj & ')'} Obviously it’s something that I've either missed or misunderstood. I'd really appreciate some help and guidance on the steps needed to delete an occurrence of a Recurring Event. Many thanks in advance, Andy PS. I do have a full annual subscription (well, 2 actually because of 2 difference companies J) |
|
Product: Xtreme SuitePro (ActiveX) v11.2.1 -> v15.2.1
Platform: Windows XP / Vista / Win 7 Language: Clarion 5.5 -> C8.x ====================================== Andy Wilton |
|
mbrogdon
Groupie Joined: 22 March 2007 Status: Offline Points: 40 |
Post Options
Thanks(0)
|
Hi Andy,
See the bold lines for key to deleting an exception occurence. You must first create an event, the set it as deleted (it will actually exist in the database), but the calendar will know not to display it because of the deleted flag.
Set excepEv = m_pCalendar.DataProvider.CreateEventEx(InEvent.EventId)
excepEv.StartTime = InEvent.RExceptionStartTimeOrig excepEv.EndTime = InEvent.RExceptionEndTimeOrig excepEv.MakeAsRExceptionEx YOURPatternID With excepEv .Subject = InEvent.Subject .Location = InEvent.Location .Body = InEvent.Body .MeetingFlag = InEvent.IsMeeting .PrivateFlag = InEvent.IsPrivate .Label = InEvent.LabelID .BusyStatus = InEvent.BusyStatus .Importance = InEvent.ImportanceLevel .StartTime = InEvent.StartDateTime .EndTime = InEvent.EndDateTime .AllDayEvent = InEvent.IsAllDayEvent .Reminder = InEvent.IsReminder .ReminderMinutesBeforeStart = InEvent.ReminderMinutesBeforeStart .ReminderSoundFile = InEvent.ReminderSoundFile .CustomProperties.LoadFromString InEvent.CustomPropertiesXMLData .ScheduleID = InEvent.ScheduleID If InEvent.IsRecurrenceExceptionDeleted = True Then .SetRExceptionDeleted True End If End With blnDisAllowUpdates = True m_pCalendar.DataProvider.ChangeEvent excepEv m_pCalendar.Populate |
|
Xtreme SuitePro ActiveX 13.2.0 - Windows XP SP3 - VB6/Ingres Openroad 2006
|
|
AndyWilton
Groupie Joined: 03 June 2008 Status: Offline Points: 82 |
Post Options
Thanks(0)
|
Hi,
I've tried the code you've suggested but its still not working . I tried it on a keypress of a button and also on the Selection Changed event.
I don't want to be cheeky but do you have any other ideas? or can you explain the process a little further?
Thanks in advance,
Andy
|
|
Product: Xtreme SuitePro (ActiveX) v11.2.1 -> v15.2.1
Platform: Windows XP / Vista / Win 7 Language: Clarion 5.5 -> C8.x ====================================== Andy Wilton |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |