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
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