How to act on email using ItemIDs

  • Thread starter Thread starter Alex Davidson
  • Start date Start date
A

Alex Davidson

I have a spam-management macro utilizing Redemption that is being used to
fwd emails to a particular address then move them to the Inbox but I'm
running into a problem where if I select more than one message, after the
first one is moved it can't reference the next item in the selection so I
thought I'd go about it by looping through to get each selected email's
ItemID and then I'd loop again to fwd and delete the messages tied to each
ItemID.

I can successfully get the ItemIDs but can someone supply the syntax to act
on them? I was using:
Set myForward = objExplorer.Selection.Item(varLoop).Forward

and have tried:
Set myForward = objExplorer.varArray(varLoop).Forward
without success.

Thanks,.
Alex
 
Store entry ids in a separate array first, then loop over the elements of
the array instead of the Selection collection.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
 
That's what I'm doing but I don't know how to use the data to act on the
messages.
 
Set Message = Application.Session.GetItemFromID(YourArray(i))
Set myForward = Message.Forward

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
 
Back
Top