Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Creating recurrence items on timetable (Read 4350 times)
rfeuer
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 12
Joined: Jan 16th, 2006
Creating recurrence items on timetable
Jan 19th, 2006 at 8:07pm
Print Post  
Hi,

I am trying to create recurrence on a timetable. Is this possible? When I use the code below nothing shows up, including my single appointment item.

       ' Recur every four days

       Dim app As Appointment = Nothing

       Dim start As DateTime = DateTime.Now
       ' Recur every four days
       Dim Recurrence As Recurrence = New Recurrence
       Recurrence.Pattern = RecurrencePattern.Daily
       Recurrence.DailyRecurrence = DailyRecurrence.ByDayInterval
       Recurrence.Days = 4
       Recurrence.RecurrenceEnd = RecurrenceEnd.Never
       Recurrence.StartDate = start

       app = New Appointment
       app.HeaderText = "Recurring event"
       app.StartTime = start
       app.EndTime = DateAdd(DateInterval.Minute, 25, start)
       app.Recurrence = Recurrence
       Me.Calendar2.Schedule.Items.Add(app)
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Creating recurrence items on timetable
Reply #1 - Jan 20th, 2006 at 6:34am
Print Post  
Hi,

Recurring items use the start and end times defined in the Recurrence object, and not the ones defined in the master item. Try initializing the fields of the Recurrence as shown below:

       Recurrence.StartHour = app.StartTime.Hour
       Recurrence.StartMinute = app.StartTime.Minute
       Recurrence.EndHour = app.EndTime.Hour
       Recurrence.EndMinute = app.EndTime.Minute

Place these lines of code after the start and end time of the appointment object have been set.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
rfeuer
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 12
Joined: Jan 16th, 2006
Re: Creating recurrence items on timetable
Reply #2 - Jan 20th, 2006 at 3:27pm
Print Post  
Thanks works like a gem!!!
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint