PC Review


Reply
Thread Tools Rate Thread

Adding Recurring Appointment to Outlook Vb.net

 
 
ymw
Guest
Posts: n/a
 
      6th Jul 2005
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.

 
Reply With Quote
 
 
 
 
Sue Mosher [MVP-Outlook]
Guest
Posts: n/a
 
      6th Jul 2005
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" <(E-Mail Removed)> wrote in message news:(E-Mail Removed)...
> 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.
>

 
Reply With Quote
 
ymw
Guest
Posts: n/a
 
      6th Jul 2005
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).

 
Reply With Quote
 
ymw
Guest
Posts: n/a
 
      7th Jul 2005
I worked out the problem, thanks!

 
Reply With Quote
 
Sue Mosher [MVP-Outlook]
Guest
Posts: n/a
 
      8th Jul 2005
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" <(E-Mail Removed)> wrote in message news:(E-Mail Removed)...
>I worked out the problem, thanks!
>

 
Reply With Quote
 
ymw
Guest
Posts: n/a
 
      11th Jul 2005
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.

 
Reply With Quote
 
Sue Mosher [MVP-Outlook]
Guest
Posts: n/a
 
      11th Jul 2005
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" <(E-Mail Removed)> wrote in message news:(E-Mail Removed)...
>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.
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
When i open an existing appointment in Outlook Calendar, then close, it automatically creates an unwanted recurring appointment. David H Microsoft Outlook Calendar 1 28th Jun 2007 10:32 AM
Recurring outlook appointment keri Microsoft Outlook 2 24th Jan 2007 08:21 PM
Recurring appointment on outlook =?Utf-8?B?RGV6YQ==?= Microsoft Outlook Calendar 0 23rd Jan 2007 08:29 AM
Recurring appointment/events linked to other recurring appointment =?Utf-8?B?dWFld2hpdGV5?= Microsoft Outlook Calendar 0 2nd Feb 2006 07:55 PM
How to get the currently selected appointment start & enddate of a single appointment in a recurring appointment series? Fredrik Nelson Microsoft Outlook VBA Programming 0 29th Apr 2004 04:18 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:15 AM.