This article will share you 2 approaches to export a specific date range of Outlook calendar as an iCalendar (.ics) file. You can choose either to your liking.
In Outlook, you can export a whole calendar as iCalendar (.ics) file just via “Save as” feature. However, if you would like to quickly export a specific date range of the calendar as iCalendar, both the inbuilt “Save as” or “Export” function can’t help. Thus, here we will introduce 2 means to you.
Method 1: Export by “E-mail Calendar” Feature
- In the first place, launch your Outlook application.
- Then switch to the “Calendar” area.
- Next you should select the specific calendar in the left navigation pane.
- After that, you should find and hit the “E-mail Calendar” button in the ribbon.
- At once, a new email will show up with a “Send a Calendar via E-mail” dialog box.
- Now, you can specify the date range in this dialog box, like the image below:
- After you click on “OK” button, the calendar in the specified date range will be converted to an iCalendar file, attached in the current email.
- Next, you can narrow down the current Outlook inspectors until you see your Windows desktop.
- Eventually, you can drag and drop the attached ics file to the desktop, shown as the screenshot below:
Method 2: Export via Outlook VBA
- To start with, in the main Outlook window, press “Alt + F11” keys/
- Next you will enter the Outlook VBA editor in success, in which you should open an empty module.
- Subsequently, copy the following VBA code into this module.
Sub ExportCalender_inSpecificDateRange_AsiCalendarFile() Dim objCalendarFolder As Outlook.Folder Dim objCalendarExporter As Outlook.CalendarSharing Dim dStartDate As Date Dim dEndDate As Date Dim objShell As Object Dim objSavingFolder As Object Dim strSavingFolder As String Dim striCalendarFile As String 'Get the current Calendar folder Set objCalendarFolder = Outlook.Application.ActiveExplorer.CurrentFolder If Not objCalendarFolder Is Nothing And objCalendarFolder.DefaultItemType = olAppointmentItem Then Set objCalendarExporter = objCalendarFolder.GetCalendarExporter 'Enter the specific start date and end date dStartDate = InputBox("Enter the start date, such as 7/1/2017:", "Specify Start Date") dEndDate = InputBox("Enter the end date, such as 8/31/2017:", "Specify End Date") If dStartDate <> #1/1/4501# And dEndDate <> #1/1/4501# Then 'Select a Windows folder for saving the exported iCalendar file Set objShell = CreateObject("Shell.Application") Set objSavingFolder = objShell.BrowseForFolder(0, "Select a folder:", 0, "") strSavingFolder = objSavingFolder.self.Path If strSavingFolder <> "" Then striCalendarFile = strSavingFolder & "\" & "Calendar from " & Format(dStartDate, "YYYY-MM-DD") & " to " & Format(dEndDate, "YYYY-MM-DD") & ".ics" 'Export the calendar in specific date range With objCalendarExporter .IncludeWholeCalendar = False .StartDate = dStartDate .EndDate = dEndDate .CalendarDetail = olFullDetails .IncludeAttachments = True .IncludePrivateDetails = False .RestrictToWorkingHours = False .SaveAsICal striCalendarFile End With MsgBox "Calendar Exported Successfully!", vbInformation End If Else MsgBox "Open a calendar folder, please!", vbExclamation + vbOKOnly End If End If End Sub
- Later, you can add the new macro to Quick Access Toolbar.
- Ultimately, you can try this VBA project.
- First, access the calendar which you want to export.
- Then click the new macro button in Quick Access Toolbar.
- Next you will be required to specify the date range – start and end date.
- After that, you need to select a Windows folder for saving the ics file.
- Lastly, the calendar in the specific date range will be exported as ics file.
Take Adequate Precautions to Avoid PST Corruption
You should accept an unquestioned fact that Outlook is vulnerable. Therefore, it is advisable to make periodic PST backups. Plus, you ought to keep an eye on all potential dangers, such as disguised viruses in emails. In addition, it is prudent to prepare a specialized Outlook recovery 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 recover sql and outlook repair software products. For more information visit www.datanumen.com
Leave a Reply