hey,
somehow the code deletes only a single item
and i have a loop in there strange
what i am missing?
this is my code
tnx for any help
salsa :)
somehow the code deletes only a single item
and i have a loop in there strange
what i am missing?
this is my code
Code:
Dim oOutlook As New Outlook.Application
Dim oNameSpace As Namespace
Dim Appointment As Object
Dim OcalItems As Items
Dim AppointmentDate As String
Set oNameSpace = oOutlook.GetNamespace("MAPI")
Set OcalItems = oNameSpace.GetDefaultFolder(olFolderCalendar).Items
AppointmentDate = "06.02.2002 10:30:00"
Set Appointment = OcalItems.GetFirst
Do While Not (Appointment Is Nothing)
If Appointment.Start < AppointmentDate Then
Appointment.Delete
End If
Set Appointment = OcalItems.GetNext
Loop
Set Appointment = Nothing
Set OcalItems = Nothing
Set oNameSpace = Nothing
Set oOutlook = Nothing
salsa :)