Adding Recurring Appointment to Outlook Vb.net

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.
 
S

Sue Mosher [MVP-Outlook]

Instead of

RecurrenceDayOfWeek = JanusAppt.RecurrencePattern.DayOfWeek

try

RecurrenceDayOfWeek = JanusAppt.RecurrencePattern.DayOfWeekMask
 
Y

ymw

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).
 
Y

ymw

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.
 
S

Sue Mosher [MVP-Outlook]

That's pretty unfortnate to have an enum that uses the same names but different numeric values.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top