Remove previously downloaded RSS items after deleting feeds in Outlook 2013

0

I have deleted my RSS feeds in Outlook 2013 via File > Account Settings > RSS Feeds

However the RSS feeds are still available in the left hand side of Outlook 2013. I thought that I might have had to close and reopen Outlook 2013 for the changes [deletion of RSS feeds] to take effect, but nothing happens. So what's going on and what shall I do?

mms911

Posted 2013-08-19T18:01:12.270

Reputation: 297

1Perhaps it's retaining the folders full of items it's already retrieved, but not checking for anything new. Can you delete (e.g. right-click, "Delete" or "Remove") the feeds where they're listed in the left-hand sidebar? – Aaron Miller – 2013-08-19T18:18:53.167

I don't have time to delete over 300 RSS feeds one-by-one from the left-hand sidebar. – mms911 – 2013-08-19T18:58:06.813

Fair enough; can they be multiple-selected via Shift- or Ctrl-click? Failing that, what happens if you just delete the parent "RSS Feeds" folder entirely? (I'm assuming the folder structure resembles that described in this Office KB article.)

– Aaron Miller – 2013-08-19T19:46:31.247

I can't do multiple selection for the feeds from from the left-hand sidebar. That's why I learnt that I shall go to account settings for bulk feeds removal. I don't have feeds in folders like the illustration on Office website.

here's a screenshot for clarification http://i44.tinypic.com/2ebfp7b.png

– mms911 – 2013-08-19T21:09:13.330

Blech. Well, at least Outlook's got a halfway decent Visual Basic API -- see my answer. – Aaron Miller – 2013-08-19T22:42:39.740

Answers

0

You've just got to love how consistent Microsoft isn't with its UI conventions, such as multiple select via Shift/Ctrl-click -- sometimes they work, sometimes they don't, and it turns out the simplest way of solving this problem is by means of Visual Basic automation.

Prefatory note: I've tested this in Outlook 2007, which is the only version to which I currently have access; that said, the Outlook VBA API is generally quite stable in my experience, and I would not expect it to change so drastically in only two major versions as to prevent the following code from working. If it fails, please comment describing its misbehavior in as much detail as possible, and I'll attempt to debug.

Start by opening the VBA editor via Alt-F11. (If that doesn't work, you can open the editor from the Developer tab, which you'll first need to add to the ribbon. This you do by clicking the File tab, then Options; in the Options window, click "Customize Ribbon" in the left-hand pane, select "Main Tabs" from the "Customize the Ribbon" dropdown, and check the "Developer" box. Once you have the Developer tab, select it, then click "Visual Basic".)

In the Visual Basic editor, expand "Project1", then "Microsoft Office Outlook Objects"; then, right-click "ThisOutlookSession" and choose "Insert", then "Module". This should give you a blank window entitled "Project1 - Module1 (Code)". In that window, paste the following, which originated here:

Private Function GetFolder(ByVal FolderPath As String) As Outlook.folder
    Dim TestFolder As Outlook.folder
    Dim FoldersArray As Variant
    Dim i As Integer

    On Error GoTo GetFolder_Error
    If Left(FolderPath, 2) = "\\" Then
        FolderPath = Right(FolderPath, Len(FolderPath) - 2)
    End If
    'Convert folderpath to array
    FoldersArray = Split(FolderPath, "\")
    Set TestFolder = Application.Session.folders.Item(FoldersArray(0))
    If Not TestFolder Is Nothing Then
        For i = 1 To UBound(FoldersArray, 1)
            Dim SubFolders As Outlook.folders
            Set SubFolders = TestFolder.folders
            Set TestFolder = SubFolders.Item(FoldersArray(i))
            If TestFolder Is Nothing Then
                Set GetFolder = Nothing
            End If
        Next
    End If
    'Return the TestFolder
    Set GetFolder = TestFolder
    Exit Function

    GetFolder_Error:
        Set GetFolder = Nothing
        Exit Function
End Function

Private Sub DeleteFolders(ByVal oFolder As Outlook.folder)
    Dim folders As Outlook.folders
    Dim folder As Outlook.folder
    Dim foldercount As Integer

    On Error Resume Next
    Set folders = oFolder.folders
    foldercount = folders.Count
    If foldercount Then
        For Each folder In folders
            folder.Delete
            DeleteFolders folder
        Next
    End If
End Sub

Sub DeleteAllRssFeedsFolders()
    Dim folder As Outlook.folder
    ' If your PST isn't loaded under the name "Personal Folders", then edit the 
    ' folder path below and replace "Personal Folders" with whatever name heads
    ' the folder tree whose RSS feed contents you wish to remove.
    Set folder = GetFolder("\\Personal Folders\RSS Feeds")
    If Not (folder Is Nothing) Then
        DeleteFolders folder
    End If
End Sub

Near the bottom, note the following: GetFolder("\\Personal Folders\RSS Feeds"). In the unlikely case that your folder tree is not headed with the name "Personal Folders", you will need to edit this line to replace "Personal Folders" with whatever name heads your folder tree. If you do not, the code will fail, probably silently.

Once you've got the code pasted in and done any necessary editing, run the code by pressing F5, or clicking the "Run" menu and then "Run Sub/UserForm". You should be prompted to choose the macro to run; the only item in the list, already selected, should be "DeleteAllRssFeedsFolders". Select that item if necessary, and then click "Run". You should see RSS folders start disappearing immediately; it may take a minute or two for the process to finish, especially with a few hundred folders to delete, but once it's done, your problem should be solved.

If you suspect this is something you'll want to do frequently, you'll probably want to save the VBA project and possibly also add a menu/ribbon item to invoke it, a task in which I have no particular interest or knowledge and which therefore is left as an exercise for the interested reader. (If you don't save the project at any other time, you will be prompted to save it upon closing Outlook; if you don't want to keep it around, just say "No".)

Aaron Miller

Posted 2013-08-19T18:01:12.270

Reputation: 8 849