HOWTO: Delete a Outlook Search Folder programatically

Search folders are very useful but there is no way available using Outlook Object Model to delete them, you need CDO to delete them.

Below code can help you remove the SearchFolders from Outlook

 Function RemoveSearchFolder(ByVal strProfile, ByVal strFolderName As String) As Boolean 

Const CdoPR_FINDER_ENTRYID = &H35E70102 
Dim objSession As MAPI.Session 
Dim objInfostore As MAPI.InfoStore 
Dim objFinderFolder As MAPI.Folder 
Dim objFolder As MAPI.Folder 
Dim strFinderEntryID As String


Set objSession = New MAPI.Session

objSession.Logon ProfileName:=strProfile, ShowDialog:=False

Set objInfostore = objSession.GetInfoStore(objSession.Inbox.StoreID)
strFinderEntryID = objInfostore.Fields.Item(CdoPR_FINDER_ENTRYID).Value
Set objFinderFolder = objSession.GetFolder(strFinderEntryID, objInfostore.ID)

For Each objFolder In objFinderFolder.Folders
    If LCase(strFolderName) = LCase(objFolder.Name) Then
        objFolder.Delete
        RemoveSearchFolder = True
        Exit Function
    End If
Next

objSession.Logoff
End Function