Delete Calendar Item Bypassing Deleted Items folder

Status
Not open for further replies.
Outlook version
Outlook 2010 64 bit
Email Account
Office 365 Exchange
Greetings!

I'm still working out the kinks in my macro. Here's my latest issue. I was finding that after a short time, I couldn't delete the "Print" calendar folder.

After a lot of investigation I discovered that it is because the previous deletion had left the folder and its items in the Deleted Items folder.

My current code is:

Set objCalendar = Session.GetDefaultFolder(olFolderCalendar)
Set printCal = objCalendar.Folders("Print")
printCal.Delete

Can you suggest a way to by-pass the deleted items folder so that it will delete correctly next time?

Best,

Jeanne ("Always Grateful") Goodman
 

Diane Poremsky

Senior Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
i think it allows like 10 copies of the print calendar, then you need to empty deleted items.


Try something like this after deleting Print
Dim oDeletedItems As Outlook.Folder
Dim oFolders As Outlook.folders

Set oDeletedItems = Application.Session.GetDefaultFolder(olFolderDeletedItems)
Set oFolders = oDeletedItems.Folders
oFolders.Item("Print").Delete


if that doesn't work, use this to delete all folders
Dim oDeletedItems As Outlook.Folder
Dim oFolders As Outlook.folders

Set oDeletedItems = Application.Session.GetDefaultFolder(olFolderDeletedItems)
Set oFolders = oDeletedItems.Folders
For i = oFolders.Count To 1 Step -1
oFolders.Item(i).Delete
Next


ETA the dim statements
 
Last edited:
Status
Not open for further replies.
Top