0
我正在編寫一個簡單腳本來刪除已刪除郵件文件夾中的所有日曆對象。這樣的日曆對象包括會議確認,拒絕等等。自動刪除已刪除文件夾中的所有Outlook日曆項目
目前我有以下時,不刪除任何東西,即使檢查已刪除的郵件文件夾中有很多日程確認,declines..etc:
Dim oDeletedItems As Outlook.Folder
Dim obj As Outlook.MailItem
Dim i As Integer
'Obtain a reference to deleted items folder
Set oDeletedItems = Application.Session.GetDefaultFolder(olFolderDeletedItems)
For i = oDeletedItems.Items.Count - 1 To 1 Step -1
' Delete all appointment items
If oDeletedItems.Items(i).Class = AppointmentItem Then
'Debug.Print obj.Subject
oDeletedItems.Items.Item(i).Delete
End If
Next