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

Exceptions

 Post Reply Post Reply
Author
Message
phainge View Drop Down
Groupie
Groupie
Avatar

Joined: 03 July 2009
Status: Offline
Points: 20
Post Options Post Options   Thanks (0) Thanks(0)   Quote phainge Quote  Post ReplyReply Direct Link To This Post Topic: Exceptions
    Posted: 07 January 2010 at 9:18am
Has anyone managed to get exceptions working for recurring events? I've been struggling with this for 2 days now and am just about ready to give up.
 
In the Calendar VB6 sample supplied with the Codejock controls there is an example of how to create a recurring event with an exception - I have got this working fine in the sample application, however when I try to do the same thing in my real application it refuses to work, even though I'm creating the master and exception events in exactly the same way - the exception event simply refuses to appear in the calendar control and all I see are the normal occurrences of the recurring event.
 
Has anyone had any success creating exceptions?
 
 
Peter
Back to Top
mbrogdon View Drop Down
Groupie
Groupie


Joined: 22 March 2007
Status: Offline
Points: 40
Post Options Post Options   Thanks (0) Thanks(0)   Quote mbrogdon Quote  Post ReplyReply Direct Link To This Post Posted: 11 January 2010 at 1:57am
Here is the routine I use to create exceptions. Maybe you will see something that helps.
 
The "InEvent" passed in is just a simplified object using only string and long datatypes
used to pass data between another application and VB. "ctlCal" is the caldendarcontrol.
 

Public Sub InsertException(ByRef InEvent As ExternalEvent)
   On Error GoTo Fehler
   ' **************************
   Dim excepEv As CalendarEvent
   Set excepEv = ctlcal.DataProvider.CreateEventEx(InEvent.EventId)
   excepEv.StartTime = InEvent.RExceptionStartTimeOrig
   excepEv.EndTime = InEvent.RExceptionEndTimeOrig
   excepEv.MakeAsRExceptionEx InEvent.RecurrencePatternID
   With excepEv
      If InEvent.IsRecurrenceExceptionDeleted = True Then
         .SetRExceptionDeleted (True)
      End If
      .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
      .CustomProperties.Property("groupid") = InEvent.GroupID
      .ScheduleID = InEvent.ScheduleID
      .RExceptionStartTimeOrig = InEvent.RExceptionStartTimeOrig
      .RExceptionEndTimeOrig = InEvent.RExceptionEndTimeOrig
   End With
   ctlcal.DataProvider.ChangeEvent excepEv
   ctlcal.Populate
   Exit Sub
Fehler:
   gstrErrTxt = LANG_ALLG_MODULE_NAME & MsgName & vbCrLf & _
           LANG_ALLG_ERROR_PROCKIND & "Sub" & vbCrLf & _
           LANG_ALLG_ERROR_PROC & "InsertException" & vbCrLf & _
           LANG_ALLG_ERROR_NUMBER & Err.Number & vbCrLf & _
           LANG_ALLG_ERROR_SOURCE & Err.Source & vbCrLf & _
           LANG_ALLG_ERROR_DESCRIPTION & Err.Description
End Sub
Xtreme SuitePro ActiveX 13.2.0 - Windows XP SP3 - VB6/Ingres Openroad 2006
Back to Top
phainge View Drop Down
Groupie
Groupie
Avatar

Joined: 03 July 2009
Status: Offline
Points: 20
Post Options Post Options   Thanks (0) Thanks(0)   Quote phainge Quote  Post ReplyReply Direct Link To This Post Posted: 11 January 2010 at 4:22am
Hi mbrogdon,
 
Thanks for that.  That's basically exactly what I'm already doing.
 
I think the only difference between your code and mine is that I add the appointments as part of the calendar control DoRetrieveDayEvents event.  Basically I call the calendar control Populate method first, which then fires the DoRetrieveDayEvents event for each day in the calendar control view, which reads the events for that day from the provider (in this case Microsoft Outlook) and adds these to the calendar control, and it's during this process that the master event and its exception are added.  My code matches the sample VB6 code supplied by Codejock, which also calls the Populate method first before adding the master event and its exception.
 
Peter
Xtreme SuitePro (ActiveX) 15.1.3
Windows 7 Pro (64bit) SP1
Visual Basic 6.0 SP4
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.188 seconds.