Adding Recurring Appointment to Outlook Vb.net

  • Thread starter Thread starter ymw
  • Start date Start date
Y

ymw

I'm trying to add a recurring appointment to Outlook through vb.net.
When I try assigning the .dayofweekmask or .dayofmonth, i get an error
of "value not valid for this property." My code follows:
With .GetRecurrencePattern
.RecurrenceType = JanusAppt.RecurrencePattern.RecurrenceType
.Interval = JanusAppt.RecurrencePattern.Interval
RecurrenceDayOfWeek = JanusAppt.RecurrencePattern.DayOfWeek
.DayOfWeekMask = cLng(RecurrenceDayOfWeek)

recurrenceDayOfMonth = JanusAppt.RecurrencePattern.DayOfMonth
.DayOfMonth = CLng(RecurrenceDayOfMonth)
.PatternStartDate = JanusAppt.RecurrencePattern.PatternStartDate
.PatternEndDate = JanusAppt.RecurrencePattern.PatternEndDate
end With

..Recurrencetype = olweekly
..interval = 1
RecurrenceDayOfWeek = 8 (for Wednesday)
RecurrenceDayOfMonth = 6

Interestingly enough, when I check the values of recurrencetype and
interval in the immediate window and then try assigning the
recurrencedayofweek, I don't get an error.

Any help on this topic would be greatly appreciated.
 
Instead of

RecurrenceDayOfWeek = JanusAppt.RecurrencePattern.DayOfWeek

try

RecurrenceDayOfWeek = JanusAppt.RecurrencePattern.DayOfWeekMask
 
The Janus controls (which I am using for my calendar) do not have a
dayofweekmask property. Their dayofweek property is an enum of days
which matches outlook's dayofweekmask (ie, Sunday = 1, Monday = 2,
Tuesday = 4, Wednesday = 8).
 
I was assigning the recurrence type to janus's recurrence type. Janus
has the same enums for recurrence types as Outlook, but apparently,
although the words match up, the numeric values don't. The recurrence
type therefore was not weekly as I thought it was. Rather, it was
daily and daily doesn't support daysofweekmask.

Thanks for your help.
 
That's pretty unfortnate to have an enum that uses the same names but different numeric values.
 
Back
Top