How to act on email using ItemIDs

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
 
D

Dmitry Streblechenko

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
 
A

Alex Davidson

That's what I'm doing but I don't know how to use the data to act on the
messages.
 
D

Dmitry Streblechenko

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top