My company just moved from outlook 2003 to 2010. We had a button that purple flagged messages and another one that send purple flagged messages to a server database by using flag filter. [FlagStatus] = 2 Since outlook 2010 doesn't use flag color anymore, I changed the code to use category, I successfully create a new category "readyToSend" with purple color. The problem is that I can't filter all the emails with this new category. Microsoft seems to be contradicting themselves and my code doesn't work. I'm looking for an alternative.
from Items.Restrict Method (Outlook)
This method cannot be used and will cause an error with the following properties: Categories
I get that but then if you scroll down to examples you get :
"This Visual Basic for Applications (VBA) example uses the Restrict method to get all Inbox items of Business category and moves them to the Business folder. To run this example, create or make sure a subfolder called 'Business' exists under Inbox. "
Sub MoveItems()
Dim myNamespace As Outlook.NameSpace
Dim myFolder As Outlook.Folder
Dim myItems As Outlook.Items
Dim myRestrictItems As Outlook.Items
Dim myItem As Outlook.MailItem
Set myNamespace = Application.GetNamespace("MAPI")
Set myFolder = _
myNamespace.GetDefaultFolder(olFolderInbox)
Set myItems = myFolder.Items
Set myRestrictItems = myItems.Restrict("[Categories] = 'Business'")
For i = myRestrictItems.Count To 1 Step -1
myRestrictItems(i).Move myFolder.Folders("Business")
Next
End Sub
I can't get this code to work. solution 1: If i can get this to work, I can solve my problems. solution 2: Find another way to mark messages to transfer/transfered than category
thank you for help, will post code if needed