I'm importing Outlook calendar items (birthdays) using the code below...
Now the appointment subject is like "Birthday Testname 2000"
Is it possible to show the age in each occurrence instead of the year of birth ?
Code:
Sub AddBirthday(bName As String, bDate As Date)
Dim NewBday As Outlook.AppointmentItem
Dim NewPatt As Outlook.RecurrencePattern
Set olns = ThisOutlookSession.Application.GetNamespace("MAPI")
Set ContactFolder = olns.GetDefaultFolder(olFolderContacts)
Set CalendarFolder = olns.GetDefaultFolder(olFolderCalendar)
Set MyContacts = ContactFolder.Items
Set MyBirthdays = CalendarFolder.Items
Set NewBday = Outlook.CreateItem(olAppointmentItem)
NewBday.AllDayEvent = True
Set NewPatt = NewBday.GetRecurrencePattern
NewPatt.RecurrenceType = olRecursYearly
NewPatt.PatternStartDate = bDate
NewPatt.NoEndDate = True
NewPatt.DayOfMonth = Day(bDate)
NewPatt.MonthOfYear = Month(bDate)
NewBday.MeetingStatus = olNonMeeting
NewBday.Subject = "Birthday " & bName & " " & Year(bDate)
NewBday.Start = bDate
NewBday.BusyStatus = olFree
NewBday.Save
End Sub
Sub test()
AddBirthday "Testname", "2000-10-6"
End Sub
Now the appointment subject is like "Birthday Testname 2000"
Is it possible to show the age in each occurrence instead of the year of birth ?