Mark an item with a particular category

后端 未结 1 1630
失恋的感觉
失恋的感觉 2021-01-21 17:19

I want to mark an item with a particular category, based on the text within the item.

I have the following code.

Sub ProcessRSS()
    \' Read RSS items a         


        
相关标签:
1条回答
  • 2021-01-21 17:54

    You need to .Save your item after you update the category. Below is your For loop with the save. As a side note, keep in mind that you'll be overwriting any existing categories as .Categories is a comma-delimited string. You may want to test if .Categories is empty and, if not, add ", Important".

    For Each objItem In objList
        If (InStr(objItem.Body, "(WA)") > 0) Then
            objItem.Categories = "Important"
            objItem.Save
            If (InStr(objItem.Categories, "Important") > 0) Then
                iCount = iCount + 1
            End If
        End If
    Next
    
    0 讨论(0)
提交回复
热议问题