Very slightly modified from an example from the Outlook VBA Help on
Items.Restrict. Always use the Object Browser to look for examples and
sample code:
Public Sub ApptDateCheck()
Dim myNamespace As Outlook.NameSpace
Dim myAppts As Outlook.Items
Dim myItems As Outlook.Items
Dim myItem As Object
Dim i As Long
Dim DateStart As Date
DateStart = Date
Set myNamespace = Application.GetNamespace("MAPI")
Set myAppts = myNamespace.GetDefaultFolder(olFolderCalendar).Items
Set myItems = myAppts.Restrict("[End] < """ & DateStart & """")
For i = myItems.Count To 1 Step -1
Set myItem = myItems.Item(i)
If (myItem.Class = olAppointment) Then
myItem.Delete
End If
Next
End Sub
"Orion Cochrane" <OrionCochrane> wrote in message
news:0FBA4472-6405-49AA-B059-A9470FB38C8A@microsoft.com...
> Can you give me the code to do that?
> > I am running on Office 2003, unless otherwise stated.