Print Page | Close Window

Exceptions

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Calendar
Forum Description: Topics Related to Codejock Calendar
URL: http://forum.codejock.com/forum_posts.asp?TID=15965
Printed Date: 06 October 2024 at 3:26pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Exceptions
Posted By: phainge
Subject: Exceptions
Date 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



Replies:
Posted By: mbrogdon
Date 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


Posted By: phainge
Date 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



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net