Does anyone know the VBA code to invoke the "Clean Up Folder" Outlook 2010 command on the right-click menu when right-clicking on a folder?
I have gotten this far in VBA code to get to the folders I want to clean up:
Private Sub CleanUpAllFolders()
Dim Folders As Outlook.Folders
Dim Folder As Outlook.Folder
Set Folders = Session.GetDefaultFolder(olFolderInbox).Parent.Folders
For Each Folder In Folders
If Left(Folder.Name, 1) = "_" Then
' Clean up folder... how do I invoke that command from VBA on this folder?
End If
Next
End Sub
However, I can't see any method on the Folder object itself that lets me invoke "Clean Up Folder".
How do I invoke one of those right-click menu commands on the current selected folder in VBA?