P
Peter Marchert
Hello,
I`m trying to create birthday appointments the same way like Outlook
does if you add a birthday in a contact. With this code I´m not able
to do so:
Sub CreateBirthday()
Dim objAppointment As Outlook.AppointmentItem
Dim objRecPattern As Outlook.RecurrencePattern
Set objAppointment =
Outlook.Session.GetDefaultFolder(olFolderCalendar).Items.Add
With objAppointment
.ReminderSet = True
.Subject = "Test"
.AllDayEvent = True
.Start = CLng(27820) ' 3/1/1976
Set objRecPattern = .GetRecurrencePattern
objRecPattern.RecurrenceType = olRecursYearly
objRecPattern.PatternStartDate = CLng(27820)
objRecPattern.NoEndDate = True
.Save
End With
Set objRecPattern = Nothing
Set objAppointment = Nothing
End Sub
I expected a recurrence like:
End after:
End by: None
but I get a recurrence like this:
End after: 10
End by: Fri 3/1/1985
Is the used code wrong or does a workarround exists to get the same
result like Outlook?
I ask this question because my program creates birthday in that way
and a user have problems with the appointments after synchronizing
with his handy. May be it has to do with the way I create the items?
Btw: Setting the occurrences takes no effect
(objRecPattern.Occurrences = 1), it is still 10.
Thanks
Peter
I`m trying to create birthday appointments the same way like Outlook
does if you add a birthday in a contact. With this code I´m not able
to do so:
Sub CreateBirthday()
Dim objAppointment As Outlook.AppointmentItem
Dim objRecPattern As Outlook.RecurrencePattern
Set objAppointment =
Outlook.Session.GetDefaultFolder(olFolderCalendar).Items.Add
With objAppointment
.ReminderSet = True
.Subject = "Test"
.AllDayEvent = True
.Start = CLng(27820) ' 3/1/1976
Set objRecPattern = .GetRecurrencePattern
objRecPattern.RecurrenceType = olRecursYearly
objRecPattern.PatternStartDate = CLng(27820)
objRecPattern.NoEndDate = True
.Save
End With
Set objRecPattern = Nothing
Set objAppointment = Nothing
End Sub
I expected a recurrence like:
End after:
End by: None
but I get a recurrence like this:
End after: 10
End by: Fri 3/1/1985
Is the used code wrong or does a workarround exists to get the same
result like Outlook?
I ask this question because my program creates birthday in that way
and a user have problems with the appointments after synchronizing
with his handy. May be it has to do with the way I create the items?
Btw: Setting the occurrences takes no effect
(objRecPattern.Occurrences = 1), it is still 10.
Thanks
Peter