Creating yearly recurrence appointment

  • Thread starter hemaneelagiri via OfficeKB.com
  • Start date
H

hemaneelagiri via OfficeKB.com

i am creating recurring appointments from my code..
i am following help file from vba editor
every thing working perfectly

except when i select my recuuring pattern

Yearly January 3rd for 10 occurances and start date is today(ie: 10/15/2009)

i am giving like bellow

recurrencePattern.RecurrenceType = Microsoft.Office.Interop.Outlook.
OlRecurrenceType.olRecursYearly;

recurrencePattern.DayOfMonth = 3;
recurrencePattern.MonthOfYear = 1;


means it sholud start from janudary 3rd 2010

but it is not certaing on january..
it is creating on october 3rd

please help me
 
H

hemaneelagiri via OfficeKB.com

and i want to create daily Evry weekday, how can v set every week day , if v
give
Interval then it sets daily

how can we set "DayOfWeekMask"

when i set like this
recurrencePattern.DayOfWeekMask = Microsoft.
Office.Interop.Outlook.OlDaysOfWeek.olMonday | Microsoft.Office.Interop.
Outlook.OlDaysOfWeek.olTuesday | Microsoft.Office.Interop.Outlook.
OlDaysOfWeek.olWednesday | Microsoft.Office.Interop.Outlook.OlDaysOfWeek.
olThursday | Microsoft.Office.Interop.Outlook.OlDaysOfWeek.olFriday;


it is giving error
please help me
 
K

Ken Slovak - [MVP - Outlook]

If you look at the VBA Help on the MonthOfYear property you will see that
setting it to 1 wouldn't mean the recurrence starts in January, it means
that it should only recur every January. However, that can be changed or
overridden by other settings you make and the order in which they are set.

If I wanted a yearly recurrence starting on January 3, 2010 I'd set the
StartTime to January 3 at a specific time and set a yearly recurrence.

So, in pseudocode:

set recurrence type to yearly
set recurrence start to January 3, 2010
set occurrences to 10

Because you often find that the actual pattern generated from settings in
the UI dialog don't match I've found the best way to handle things if I have
questions is to create an actual dummy recurring appointment with the
pattern I want in the UI dialog, then I analyze the resulting
RecurrencePattern on the recurring series to see how Outlook interpreted the
pattern I wanted.
 
K

Ken Slovak - [MVP - Outlook]

Are you setting the recurrence type to recurs weekly first? Then you OR the
days you want into the mask you set. To make things easier to debug I derive
the OR'd value first and then set that result for the DayOfWeekMask
property.
 
H

hemaneelagiri via OfficeKB.com

Hi
Thanks for your support


i am setting the recurrence type to recurs daily and i am setting
recurrencePattern.DayOfWeekMask = (Microsoft.Office.Interop.Outlook.
OlDaysOfWeek)62;
then it is giving bellow error
"The property for the recurrence type is not valid. Verify your code."

if i set weekly and dayofmask it is working properly but when i recurrence
pattern there weekly type and week days checkbox is selecting but i want to
select daily and weekday options

Thanks
 
K

Ken Slovak - [MVP - Outlook]

You have to use code that works, not what you'd like to use. If those are
the settings you want you have to use the weekly type with the day of the
week mask set. Otherwise it won't work.
 

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