Many Outlook users are used to classifying their calendar items based on whether items are private or not. If so do you, you may hope to auto mark birthday events as private in your calendar. Now, this article will help you realize it with ease.
For instance, you frequently need to print your Outlook calendar without private items. And to your mind, the birthday events are private items as well. Therefore, not only must you ensure all the existing birthday events are private, but also you have to let Outlook auto mark each new birthday events as private. It is very easy to change the status of existing items. However, what to do with the new ones? Don’t worry. In the followings, we will introduce you a smart way to realize it.
Auto Mark Birthday Events as Private in Calendar
- At first, launch Outlook and access VBA editor.
- Then, put the VBA code below into the “ThisOutlookSession” project.
Private WithEvents objCalendar As Outlook.Folder Private WithEvents objCalendarItems As Outlook.Items Private Sub Application_Startup() Set objCalendar = Outlook.Application.Session.GetDefaultFolder(olFolderCalendar) Set objCalendarItems = objCalendar.Items Call MarkExistingBirthdayEventsPrivate End Sub 'Auto mark the new birthday event as private Private Sub objCalendarItems_ItemAdd(ByVal Item As Object) Dim objBirthdayEvent As Outlook.AppointmentItem If (Item.MeetingStatus = olNonMeeting) And (Item.IsRecurring = True) And (Right(Item.Subject, 11) = "'s Birthday") Then Set objBirthdayEvent = Item objBirthdayEvent.Sensitivity = olPrivate objBirthdayEvent.Save End If End Sub 'Mark all existing birthday events as private Private Sub MarkExistingBirthdayEventsPrivate() Dim objCalendarItem As Outlook.AppointmentItem For Each objCalendarItem In objCalendarItems If (objCalendarItem.MeetingStatus = olNonMeeting) And (objCalendarItem.IsRecurring = True) And (Right(objCalendarItem.Subject, 11) = "'s Birthday") Then objCalendarItem.Sensitivity = olPrivate objCalendarItem.Save End If Next End Sub
- Afterwards, move the cursor back to the “Application_Startup” subroutine.
- Now, press “F5” key button to validate this macro.
- At once, all the existing birthday events will be changed to “Private” status.
- Besides, since then, every new birthday event in this calendar will be shown as “Private” automatically.
Fix Compromised Outlook PST File
By far, Outlook has already earned a lot of appreciates due to its various excellent functions. Simply put, Outlook is not only a standalone email client only but also a private schedule manager of users. Hence, more and more users prefer Outlook than other email clients. Yet, it also has a flaw – prone to corruption. For instance, if you accidentally open a malicious link, your Outlook file can get virus-infected, thereby leading to PST data damage. At that moment, you have to make use of an experienced repair tool, like DataNumen Outlook Repair, to fix PST and get back valuable data.
Shirley Zhang is a data recovery expert in DataNumen, Inc., which is the world leader in data recovery technologies, including repair SQL Server and outlook repair software products. For more information visit www.datanumen.com