How to Not Auto Create a Birthday Appointment When Setting Birthday for a Contact

By default, when you fill in contact birthday, Outlook will automatically create the birthday appointments in calendar. If you dislike this, you can utilize VBA to undo it by auto deleting the birthday appointment, which will be introduced in this post.

You must have noticed that whenever you fill in or change the birthday field for a contact, Outlook will auto generate the recurring birthday appointment in the calendar. However, many actually dislike this as the birthday appointments will mix with other common appointments or meetings, which will surely clutter up their daily schedule. Therefore, many would like to set the birthdays without the birthday appointments. You can apply the following VBA codes to undo it by auto deleting the birthday appointments.

Not Auto Create a Birthday Appointment When Setting Birthday for a Contact

Not Auto Create a Birthday Appointment When Setting Birthday for a Contact

  1. In the first place, launch your Outlook application.
  2. Then press “Alt + F11” key shortcuts to access Outlook VBA editor.
  3. Next open the “ThisOutlookSession” project.
  4. Subsequently, copy and paste the following codes into this project window.
Public WithEvents objItems As Outlook.Items

Private Sub Application_Startup()
    Set objItems = Outlook.Application.Session.GetDefaultFolder(olFolderContacts).Items
End Sub

Private Sub objItems_ItemChange(ByVal objItem As Object)
    Dim objContact As Outlook.ContactItem
    Dim objAppointments As Outlook.Items
    Dim strFilter As String
    Dim objBirthdayAppointments As Outlook.Items
    Dim objBirthdayAppointment As Outlook.AppointmentItem

    If objItem.Class = olContact Then
       Set objContact = objItem
 
       'If the birthday field is not blank
       If objContact.Birthday <> #1/1/4501# Then
 
          'Find the appointment series for the contact birthday
          Set objAppointments = Outlook.Application.Session.GetDefaultFolder(olFolderCalendar).Items
          objAppointments.IncludeRecurrences = True
          strFilter = "[Subject] = " & objContact.FullName & "'s Birthday"
          Set objBirthdayAppointments = objAppointments.Restrict(strFilter)
 
         'Delete the generated birthday appointment series
         For Each objBirthdayAppointment In objBirthdayAppointments
             objBirthdayAppointment.Delete
         Next
 
      End If
    End If
End Sub

VBA Code - Not Auto Create a Birthday Appointment When Setting Birthday for a Contact

  1. After that, you should sign this macro, namely assigning a digital certificate to the current macro.
  2. Later change your Outlook macro settings to permit the signed VBA project.
  3. Eventually, you can restart Outlook to activate the new macro.
  4. From now on, whenever you fill in or change the birthdays, the according birthday appointments will be automatically deleted

Prevent Disgusting PST Data Loss

Although Outlook boasts of multiple Outlook features, it still cannot be immune from PST errors or corruption. It means that PST corruption or loss can happen at any time. Therefore, you have to spend a great number of efforts to safeguard your PST data, such as sticking to backing up your PST data regularly. Moreover, if you can afford it, it is recommended to keep a powerful corrupted Outlook PST repair tool, such as DataNumen Outlook Repair.

Author Introduction:

Shirley Zhang is a data recovery expert in DataNumen, Inc., which is the world leader in data recovery technologies, including sql recovery and outlook repair software products. For more information visit www.datanumen.com

Comments are closed.