By default, you are not allowed to change the start and end time of all-day events as per your wishes in your Outlook. Now, this article will show you how to set the default start and end time of all-day events as per your working hours.
As you can see, when you enable the “All day event” option in an appointment, both the “Start Time” and “End Time” fields will be greyed out. In this scenario, it means that you aren’t permitted to change them to your liking. Therefore, in the followings, we will share you a method to set the default start and end time of all day events on basis of your working hours in your Outlook.
Set the Default Start and End Time of All-day Events as per Working Hours
- To start with, launch your Outlook program.
- After you get into the main Outlook screen, you can press the “Alt + F11” key buttons.
- Subsequently, you will get access to the Outlook VBA editor window.
- In the current “Microsoft Visual Basic for Applications” window, you need to open the “ThisOutlookSession” project window.
- Then copy the following VBA code into this project.
Public WithEvents objInspectors As Outlook.Inspectors Public WithEvents objAppointment As Outlook.AppointmentItem Private Sub Application_Startup() Set objInspectors = Outlook.Application.Inspectors End Sub Private Sub objInspectors_NewInspector(ByVal Inspector As Inspector) If Inspector.CurrentItem.Class = olAppointment Then Set objAppointment = Inspector.CurrentItem End If End Sub Private Sub objAppointment_PropertyChange(ByVal Name As String) Dim dOccuringDate As Date If Name = "AllDayEvent" Then If objAppointment.AllDayEvent = True Then dOccuringDate = Format(objAppointment.Start, "Short Date") 'Change the Start and End Time as per Working Hours With objAppointment .AllDayEvent = False .Start = dOccuringDate & " 9:00:00 AM" .End = dOccuringDate & " 6:00:00 PM" End With End If End If End Sub Private Sub objAppointment_Open(Cancel As Boolean) If objAppointment.AllDayEvent = True Then dOccuringDate = Format(objAppointment.Start, "Short Date") With objAppointment .AllDayEvent = False .Start = dOccuringDate & " 9:00:00 AM" .End = dOccuringDate & " 6:00:00 PM" End With End If End Sub
- After that, you need to sign this code. Click “Tools” > “Signature”.
- In the subsequent dialog box, follow onscreen instructions to assign a digital certificate to the new VBA project.
- Later you ought to change your Outlook macro settings to permit digitally signed macros.
- Eventually you can restart your Outlook application to activate this macro.
- From now on, every time you enable the “All day event” option in an Outlook appointment, the appointment’s start and end time will be changed to your working hours, like the following screenshot:
Retrieve Precious Data from Compromised Outlook file
Though Outlook boasts of multiple various features, it doesn’t mean that it is fully flawless. It still can get corrupted due to various factors, like email borne viruses, human improper handling and so on. Therefore, aside from making regular PST data backups, you’d better prepare a powerful external PST fix tool nearby, such as DataNumen Outlook Repair. It can repair PST issues in a short span of time.
Shirley Zhang is a data recovery expert in DataNumen, Inc., which is the world leader in data recovery technologies, including mdf fix and outlook repair software products. For more information visit www.datanumen.com