PDA

View Full Version : Rules only after message is read



Sandler
09-20-2017, 07:33 AM
How can I apply rules to emails, but only after the message is read?

Example: John Doe gives me information about Dog Food, so I want John Doe's email to go to dog food folder, but first I need to double-click the message, read it, and hit the X on the top right corner (closing the email) before the program is triggered to move to a specified folder.

Thanks :)

Logit
09-20-2017, 03:07 PM
.
I believe this may be what you are seeking ?

https://stackoverflow.com/questions/24069436/moving-read-mail-into-new-folders-in-outlook



Sub ReadMailMover()


Set objOutlook = CreateObject("Outlook.Application")
Set objNamespace = objOutlook.GetNamespace("MAPI")
Set objFolderSrc = objNamespace.GetDefaultFolder(olFolderInbox)
Set objFolderDst = objFolderSrc.Parent.folders("__Reviewed")


Set colitems = objFolderSrc.Items
Set colfiltereditems = colitems.Restrict("[UnRead] = False")


For intMessage = colfiltereditems.Count To 1 Step -1
colfiltereditems(intMessage).Move objFolderDst
Next


End Sub

Sandler
09-21-2017, 02:23 PM
Sort of. I don't want it to go to a reviewed folder. I just want to start creating rules right into the script to move to specific folders based on words in Subject Line or depending on who sent me an email.