I am trying to delete all my Outlook Calendar Appointments within a specific date range. But I don't want to delete any appointments that are set to a recurrence since they could be in the future. I found this code online and it works good except that it will delete the recurrence appointments too. Can anyone help me modify this to NOT include recurrence appointments? My VBA skills are terrible and even worse with Outlook.
Private Function DeleteAppts()'DeclarationsDim strCurrent As StringDim objApp As Outlook.ApplicationDim objNS As Outlook.NameSpaceDim objFolder As Outlook.MAPIFolderDim objItems As Outlook.ItemsDim objItem As ObjectDim strStart As StringDim strEnd As StringDim strFilter As String'put required start and end dates into strStart and strEnd respectively'if they are constants then just set them before this'I created textboxes for users to input the dates themselvesstrStart = "09/15/2016 07:00 AM"strEnd = "09/15/2016 16:00 PM"'create a string to use to filter the outlook itemsstrFilter = "[Start] >= " & Quote(strStart) & " And [Start] < " & Quote(strEnd)'set the outlook objects and specify the items in the calendar using the filterSet objApp = CreateObject("Outlook.Application")Set objNS = objApp.GetNamespace("MAPI")Set objFolder = objNS.GetDefaultFolder(olFolderCalendar)Set objItems = objFolder.Items.Restrict(strFilter)Set objItem = objItems.GetFirstintCount = objItems.CountFor i = intCount To 1 Step -1 Set objItem = objItems(i) objItem.DeleteNext'clears out outlook objects from memorySet objApp = NothingSet objNS = NothingSet objFolder = NothingSet objItems = NothingSet objItem = NothingMsgBox "Items Deleted!"End FunctionFunction Quote(MyText) As String Quote = Chr(34) & MyText & Chr(34)End Function