PC Review Forums Newsgroups Microsoft Outlook Microsoft Outlook VBA Programming Adding Recurring Appointment to Outlook Vb.net

Reply

Adding Recurring Appointment to Outlook Vb.net

 
Thread Tools Rate Thread
Old 06-07-2005, 04:49 PM   #1
ymw
Guest
 
Posts: n/a
Default Adding Recurring Appointment to Outlook Vb.net


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
Old 06-07-2005, 05:04 PM   #2
Sue Mosher [MVP-Outlook]
Guest
 
Posts: n/a
Default Re: Adding Recurring Appointment to Outlook Vb.net

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

  Reply With Quote
Old 06-07-2005, 06:27 PM   #3
ymw
Guest
 
Posts: n/a
Default Re: Adding Recurring Appointment to Outlook Vb.net

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
Old 07-07-2005, 02:22 PM   #4
ymw
Guest
 
Posts: n/a
Default Re: Adding Recurring Appointment to Outlook Vb.net

I worked out the problem, thanks!

  Reply With Quote
Old 08-07-2005, 09:40 PM   #5
Sue Mosher [MVP-Outlook]
Guest
 
Posts: n/a
Default Re: Adding Recurring Appointment to Outlook Vb.net

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!
>

  Reply With Quote
Old 11-07-2005, 02:24 PM   #6
ymw
Guest
 
Posts: n/a
Default Re: Adding Recurring Appointment to Outlook Vb.net

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
Old 11-07-2005, 02:45 PM   #7
Sue Mosher [MVP-Outlook]
Guest
 
Posts: n/a
Default Re: Adding Recurring Appointment to Outlook Vb.net

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

  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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off