How to Auto Move Birthday Events to a Specific Calendar in Your Outlook

Since birthday events are automatically added to the default calendar folder, they will clutter up your common appointments and meetings. If you hope to auto move them to a non-default calendar, you can use the way shared in this article.

When you add birthday information to a contact, a corresponding birthday event will be created automatically in the default calendar folder under this PST file. In this way, perhaps you’ll feel that these birthday events are making your standard schedules messed. So, you hope to store the birthday events in another calendar. In response to this requirement, here we will introduce you a way which can auto move the birthday events to a specific calendar.

Auto Move Birthday Events to a Specific Calendar

Auto Move Birthday Events to a Specific Calendar

  1. At the very beginning, in the Outlook main window, you can press “Alt + F11” key buttons.
  2. Then, you will get access to the VBA editor window, in which you will need to double click on the “ThisOutlookSession” project to open it.
  3. Next, you should copy and paste the following VBA code into this project.
Private WithEvents objDefaultCalendar As Outlook.Folder
Private WithEvents objEvents As Outlook.Items

Private Sub Application_Startup()
    'Get the default calendar folder
    Set objDefaultCalendar = Outlook.Application.Session.GetDefaultFolder(olFolderCalendar)
    Set objEvents = objDefaultCalendar.Items
End Sub

Private Sub objEvents_ItemAdd(ByVal Item As Object)
    Dim objLink As Outlook.Link
    Dim objBirthdayEvent As Outlook.AppointmentItem
    Dim objTargetCalendar As Outlook.Folder
 
    'Get newly added birthday event
     If (TypeOf Item Is AppointmentItem) And (Item.IsRecurring = True) And (Right(Item.Subject, 8) = "Birthday") Then
        If Item.links.count = 1 Then
           Set objLink = Item.links.Item(1)
           If objLink.Name = Left(Item.Subject, Len(Item.Subject) - 11) Then
              Set objBirthdayEvent = Item
 
              On Error Resume Next
              Set objTargetCalendar = objDefaultCalendar.Folders("Birthdays")
              If objTargetCalendar Is Nothing Then
                 Set objTargetCalendar = objDefaultCalendar.Folders.Add("Birthdays")
              End If
 
              'Move the birthday event to the specific calendar
              objBirthdayEvent.Move objTargetCalendar
          End If
       End If
    End If
End Sub

VBA Code - Auto Move Birthday Events to a Specific Calendar

  1. After that, you had better sign this VBA project.
  2. Later, modify your Outlook macro settings to enable digitally signed macros.
  3. Ultimately, you have to restart your Outlook application, which will activate this macro.
  4. From now on, every time a birthday event is added to the default calendar, it will be automatically moved to the predefined non-default calendar.

Outlook Is Prone to Corruption

If you have utilized Outlook for decades, you must have been subject to a variety of issues. Due to the fact that Outlook is prone to damage, you are compelled to prepare for all possibilities of Outlook data disasters. In order to rescue your data as soon as Outlook crashes, it is always suggested to keep a remarkable recovery tool handy, like DataNumen Outlook Repair. It can fix PST issues like a breeze.

Author Introduction:

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

Comments are closed.