deleting emails part 2

  • Thread starter Thread starter hb21l6
  • Start date Start date
H

hb21l6

Regarding my previous post below, is there a way to automate this macro to
run when ever an email appears in the SPAMfighter folder?

I've had a look through message rules, but theres nothing there to run the
Macro.
 
Get the folder, get its Items collection and handle the ItemAdd event on
that Items collection. That will fire every time an item is added to the
folder. Look up "ItemAdd" at www.outlookcode.com for various examples of how
to set all that up.

When you delete items in a collection never use a For...Each or For loop, as
you delete items you're changing the index and the count so you usually end
up deleting every other item and not every item. Use a Do loop with a check
for no contents in the collection or a count down For loop (Step -1) to do
that.
 
Back
Top