title: VBA: Alternative to Restrict Method with categories?
body: <p>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.</p>
  
  <p>from <a href="http://msdn.microsoft.com/en-us/library/office/aa210275%28v=office.11%29.aspx" rel="nofollow">Items.Restrict Method (Outlook)</a></p>
  
  <blockquote>
    <p>This method cannot be used and will cause an error with the following
    properties:
    <strong>Categories</strong></p>
  </blockquote>
  
  <p>I get that but then if you scroll down to examples you get :</p>
  
  <blockquote>
    <p>"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. "</p>
  </blockquote>
  
  <pre><code>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
  </code></pre>
  
  <p>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</p>
  
  <p>thank you for help, will post code if needed</p>