Hi Guy's i have had a search on Google to see if there is an adaption i can do
Does any one or has anyone used VBA to remove all outlook appointments prior to todays date ?
I have this to add an appointment but it would be good to clear historic appointments prior todays date
Code:
Set olobj = CreateObject("Outlook.Application") Set oloappt = olobj.CreateItem(olAppointmentItem)
With oloappt
If intDays = 1 Then
.Start = Nz(apptDate, "") & " " & Nz(apptStartTime, "")
End If
If intDays > 1 Then
.Start = Nz(dtStartDate, "")
.End = Nz(dtEndDate, "")
End If
If strCC <> "" Then
.RequiredAttendees = strCC
End If
.subject = strSubj & " " & "Appointment " & strName & " " & apptDate & " " & apptStartTime
.ReminderMinutesBeforeStart = 10080
.ReminderSet = True
.Location = "DMT Ltd"
.Body = Replace(strBody, "|", vbCrLf & vbCrLf)
.Save
.Close (olSave)
End With
If MsgBox("Your New Appointment Is Now Saved In Outlook Calendar", vbOKOnly, "APPOINTMENT SAVED") = vbOK Then
Set ol = CreateObject("Outlook.Application")
Set olNS = ol.GetNamespace("MAPI")
Set objCalendar = olNS.GetDefaultFolder(olFolderCalendar)
objCalendar.Display
Set olExp = objCalendar.GetExplorer
Set viw = olExp.CurrentView
viw.GoToDate Date
End If