S
Skipper
Hi i write this:
Sub CleanUp()
Dim objOL As Outlook.Application
Dim objNS As Outlook.NameSpace
Dim colCal As Outlook.Items
Dim objAppt As Outlook.AppointmentItem
Dim objTsk As Outlook.TaskItem
Set objOL = CreateObject("Outlook.Application")
Set objNS = objOL.GetNamespace("MAPI")
Set colCal = objNS.GetDefaultFolder(olFolderCalendar).Items
On Error Resume Next
For Each objAppt In colCal
If objAppt.Categories = "Work" And DateDiff("d", objAppt.Start,
Now()) > 0 Then
objAppt.Delete
End If
Next
Set objAppt = Nothing
Set objTsk = Nothing
Set colCal = Nothing
End Sub
the problem is if objAppt it's a recurring object the metod Delete remove
all, instead i want to remove only a individual occurrence.
TNX
Sub CleanUp()
Dim objOL As Outlook.Application
Dim objNS As Outlook.NameSpace
Dim colCal As Outlook.Items
Dim objAppt As Outlook.AppointmentItem
Dim objTsk As Outlook.TaskItem
Set objOL = CreateObject("Outlook.Application")
Set objNS = objOL.GetNamespace("MAPI")
Set colCal = objNS.GetDefaultFolder(olFolderCalendar).Items
On Error Resume Next
For Each objAppt In colCal
If objAppt.Categories = "Work" And DateDiff("d", objAppt.Start,
Now()) > 0 Then
objAppt.Delete
End If
Next
Set objAppt = Nothing
Set objTsk = Nothing
Set colCal = Nothing
End Sub
the problem is if objAppt it's a recurring object the metod Delete remove
all, instead i want to remove only a individual occurrence.
TNX