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

xtpCalendarRecurrenceMonthNth works?

 Post Reply Post Reply
Author
Message
mpspark View Drop Down
Newbie
Newbie


Joined: 09 January 2007
Status: Offline
Points: 6
Post Options Post Options   Thanks (0) Thanks(0)   Quote mpspark Quote  Post ReplyReply Direct Link To This Post Topic: xtpCalendarRecurrenceMonthNth works?
    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.

Back to Top
sserge View Drop Down
Moderator Group
Moderator Group


Joined: 01 December 2004
Status: Offline
Points: 1297
Post Options Post Options   Thanks (0) Thanks(0)   Quote sserge Quote  Post ReplyReply Direct Link To This Post Posted: 31 January 2007 at 5:53am
Hi,

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"

--
WBR,
Serge
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.172 seconds.