PC Review
Forums
Newsgroups
Microsoft Outlook
Microsoft Outlook VBA Programming
Adding Recurring Appointment to Outlook Vb.net
Forums
Newsgroups
Microsoft Outlook
Microsoft Outlook VBA Programming
Adding Recurring Appointment to Outlook Vb.net
![]() |
Adding Recurring Appointment to Outlook Vb.net |
|
|
Thread Tools | Rate Thread |
|
|
#1 |
|
Guest
Posts: n/a
|
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. |
|
|
|
#2 |
|
Guest
Posts: n/a
|
Instead of
RecurrenceDayOfWeek = JanusAppt.RecurrencePattern.DayOfWeek try RecurrenceDayOfWeek = JanusAppt.RecurrencePattern.DayOfWeekMask -- Sue Mosher, Outlook MVP Author of Microsoft Outlook Programming - Jumpstart for Administrators, Power Users, and Developers http://www.outlookcode.com/jumpstart.aspx "ymw" <ymwymw@gmail.com> wrote in message news:1120664971.979292.60640@o13g2000cwo.googlegroups.com... > 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. > |
|
|
|
#3 |
|
Guest
Posts: n/a
|
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). |
|
|
|
#4 |
|
Guest
Posts: n/a
|
I worked out the problem, thanks!
|
|
|
|
#5 |
|
Guest
Posts: n/a
|
What was the solution?
-- Sue Mosher, Outlook MVP Author of Microsoft Outlook Programming - Jumpstart for Administrators, Power Users, and Developers http://www.outlookcode.com/jumpstart.aspx "ymw" <ymwymw@gmail.com> wrote in message news:1120742571.366417.266480@o13g2000cwo.googlegroups.com... >I worked out the problem, thanks! > |
|
|
|
#6 |
|
Guest
Posts: n/a
|
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. |
|
|
|
#7 |
|
Guest
Posts: n/a
|
That's pretty unfortnate to have an enum that uses the same names but different numeric values.
-- Sue Mosher, Outlook MVP Author of Microsoft Outlook Programming - Jumpstart for Administrators, Power Users, and Developers http://www.outlookcode.com/jumpstart.aspx "ymw" <ymwymw@gmail.com> wrote in message news:1121088241.693319.199350@g14g2000cwa.googlegroups.com... >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. > |
|
![]() |
|
| Thread Tools | |
| Rate This Thread | |
|
|

Main Page 

