none
Delete all Page Not Found from MS Outlook RSS? RRS feed

Answers

  • Hi ryguy,

    >> is there a way to delete duplicate unread items from an RSS feed?

    For deleting the duplicate unread items, I think you need to loop through the items in RSS feed and check whether it is duplicate, if it is duplicate, and delete it.

    Here is a simple code for looping through items.

    Sub GetRssItem()
     Dim myNameSpace As Outlook.NameSpace
     Dim myFolder As Outlook.Folder
     Dim subFolder As Outlook.Folder
     Dim myItem As Object
     Set myNameSpace = Application.GetNamespace("MAPI")
     Set myFolder = myNameSpace.GetDefaultFolder(olFolderRssFeeds)
     Set subFolder = myFolder.Folders(1)
     For Each myItem In subFolder.Items
        Debug.Print myItem.Subject
     Next myItem
    End Sub

    >> delete all Page Not Found from unread items in MS Outlook RSS

    Where is Page Not Found, if it is in the body, I think you could retrieve the mail body. If you mean you need to open the link to check whether it is not found, I think you need to retrieve the link from mail body, and then use WinHttp.WinHttpRequest.5.1 to send request to the link, and then check the response, if it is not found, and then delete.

    Best Regards,

    Edward


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Marked as answer by ryguy72 Thursday, December 8, 2016 2:12 PM
    Monday, December 5, 2016 7:45 AM
  • Thanks Edward, I modified your code just a bit.  The script below works just fine for me.

    Sub GetRssItem()
    Dim myNameSpace As Outlook.NameSpace
    Dim myFolder As Outlook.Folder
    Dim subFolder As Outlook.Folder
    Dim myItem As Object
    Set myNameSpace = Application.GetNamespace("MAPI")
    Set myFolder = myNameSpace.GetDefaultFolder(olFolderRssFeeds)
    For i = 1 To 18
       Set subFolder = myFolder.Folders(i)
       Debug.Print subFolder
          For Each myItem In subFolder.Items
            If InStr(myItem.Subject, "[on hold]") > 0 Then
                Debug.Print myItem.Subject
                myItem.Delete
            End If
          Next myItem
    Next i
    End Sub


    MY BOOK

    • Marked as answer by ryguy72 Thursday, December 8, 2016 2:12 PM
    Thursday, December 8, 2016 2:12 PM

All replies

  • Hi ryguy,

    >> is there a way to delete duplicate unread items from an RSS feed?

    For deleting the duplicate unread items, I think you need to loop through the items in RSS feed and check whether it is duplicate, if it is duplicate, and delete it.

    Here is a simple code for looping through items.

    Sub GetRssItem()
     Dim myNameSpace As Outlook.NameSpace
     Dim myFolder As Outlook.Folder
     Dim subFolder As Outlook.Folder
     Dim myItem As Object
     Set myNameSpace = Application.GetNamespace("MAPI")
     Set myFolder = myNameSpace.GetDefaultFolder(olFolderRssFeeds)
     Set subFolder = myFolder.Folders(1)
     For Each myItem In subFolder.Items
        Debug.Print myItem.Subject
     Next myItem
    End Sub

    >> delete all Page Not Found from unread items in MS Outlook RSS

    Where is Page Not Found, if it is in the body, I think you could retrieve the mail body. If you mean you need to open the link to check whether it is not found, I think you need to retrieve the link from mail body, and then use WinHttp.WinHttpRequest.5.1 to send request to the link, and then check the response, if it is not found, and then delete.

    Best Regards,

    Edward


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Marked as answer by ryguy72 Thursday, December 8, 2016 2:12 PM
    Monday, December 5, 2016 7:45 AM
  • The example that you give is still there and users with the high enough reputation can see it just fine - the post is simply marked as "deleted".

    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.5 is now available!

    Monday, December 5, 2016 3:28 PM
  • Thanks Edward, I modified your code just a bit.  The script below works just fine for me.

    Sub GetRssItem()
    Dim myNameSpace As Outlook.NameSpace
    Dim myFolder As Outlook.Folder
    Dim subFolder As Outlook.Folder
    Dim myItem As Object
    Set myNameSpace = Application.GetNamespace("MAPI")
    Set myFolder = myNameSpace.GetDefaultFolder(olFolderRssFeeds)
    For i = 1 To 18
       Set subFolder = myFolder.Folders(i)
       Debug.Print subFolder
          For Each myItem In subFolder.Items
            If InStr(myItem.Subject, "[on hold]") > 0 Then
                Debug.Print myItem.Subject
                myItem.Delete
            End If
          Next myItem
    Next i
    End Sub


    MY BOOK

    • Marked as answer by ryguy72 Thursday, December 8, 2016 2:12 PM
    Thursday, December 8, 2016 2:12 PM