Print Page | Close Window

xtpCalendarRecurrenceMonthNth works?

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Calendar
Forum Description: Topics Related to Codejock Calendar
Printed Date: 01 July 2022 at 9:46pm
Software Version: Web Wiz Forums 12.04 -

Topic: xtpCalendarRecurrenceMonthNth works?
Posted By: mpspark
Subject: xtpCalendarRecurrenceMonthNth works?
Date Posted: 30 January 2007 at 11:27pm
I can't seem to get xtpCalendarRecurrenceMonthNth and xtpCalendarRecurrenceYearNth recurrence type working. Would someone show me some example codes? Here is what I tried:

rPattern.Options.RecurrenceType = xtpCalendarRecurrenceMonthNth
rPattern.Options.MonthNthIntervalMonths = txtInterval.Text
rPattern.Options.MonthNthWhichDay = WeekNumOfMonth(pStartDate.Value)   'returns week number of the month
rPattern.Options.MonthNthWhichDayMask = xtpCalendarDayWednesday  'this is just for testing purpose

What am I doing wrong? I can see this code enters a event/recurrence record in the database, but does not show up in the scheduler/calendar. The same goes for xtpCalendarRecurrenceYearNth.

Posted By: sserge
Date Posted: 31 January 2007 at 5:53am

The following values are used for MonthNthWhichDay:
1 - First
2 - Second
3 - Third
4 - Fourth
5 - Last
Here is a changed piece of code from Codejock Calendar  VB Sample, frmMain, Form_Load
Replace the existing one and test.

    Dim bAddRecurrenceEvent As Boolean
    bAddRecurrenceEvent = True
    If bAddRecurrenceEvent Then
        Dim NewEvent As CalendarEvent, Recurrence As CalendarRecurrencePattern
        Set NewEvent = CalendarControl.DataProvider.CreateEvent
        NewEvent.Subject = "RecEv"
        NewEvent.Location = "1"
        NewEvent.Body = "."
        NewEvent.ReminderSoundFile = ".."
        Set Recurrence = NewEvent.CreateRecurrence
        NewEvent.Label = 5
        Recurrence.StartTime = #3:00:00 PM#
        Recurrence.DurationMinutes = 90
        Recurrence.StartDate = Now - 2 '#4/11/2005#
        Recurrence.EndMethod = xtpCalendarPatternEndAfterOccurrences
        Recurrence.EndAfterOccurrences = 10
        Recurrence.Options.RecurrenceType = xtpCalendarRecurrenceMonthNth
        Recurrence.Options.MonthNthIntervalMonths = 3
        Recurrence.Options.MonthNthWhichDay = 5 ' WeekNumOfMonth(pStartDate.Value)   'returns week number of the month
        Recurrence.Options.MonthNthWhichDayMask = xtpCalendarDayWednesday  'this is just for testing purpose
        NewEvent.UpdateRecurrence Recurrence
        CalendarControl.DataProvider.AddEvent NewEvent
    End If

NOTE: In Version 10.4 CalendarDialogs object added to use built-in dialogs: 'Edit Event', 'Edit Recurrence', 'Reminders', 'Time Scale Properties'
See Calendar VB Sample, menu -> Calendar ->Advanced Options
set check "Use built-in calendar dialogs"


Print Page | Close Window

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