Reputation: 15561
Is there any way to know which MailItem
s satisfy a given Rule
?
I mean to move a set of emails by applying a Rule
(as a one-off operation), but then know which were these.
Upvotes: 0
Views: 50
Reputation: 66215
You can either parse the rule conditions (Rule.Conditions) and programmatically check if they apply to a particular message, or you can call Rule.Execute and let it do what it needs to do. You can set up event handler on the target folder (Items.ItemAdd) ahead of time to figure out which items were moved to the target folder.
Upvotes: 1
Reputation: 49395
You can use the Find/FindNext or Restrict methods to find Outlook items that satisfy to your conditions. Also you may find the AdvancedSearch method of the Application class helpful.
Upvotes: 1