Rule to move messages except for replies

Status
Not open for further replies.

susan_abc

Member
Outlook version
Outlook 2010 32 bit
Email Account
Exchange Server
Running Outlook 2010 in an Exchange 2010 environment. I receive a lot of email notifications of equipment and software status and almost all don’t involve me (not my equipment/software/site). I’ve set up rules to move those messages to a folder, but any replies to those messages are also moved. I want to keep all replies in my inbox so I can review them while moving out all of the “noise” of the initial emails. I’ve looked for an option in the Rules exceptions but don’t find something like “except if a reply or a forward”. How can I accomplish moving messages except for replies? Thanks in advance for the help!
 

Diane Poremsky

Senior Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
How do the rules read? Did you try adding an exception for 'except if subject is RE: " - you'll need the full subject, so it won't work if you are filtering on From address or something other than subject.

Another possibility is a run a script rule - the rule identifies the message as usual but the action is in a script - you can add an exception there if subject begins with RE: or FW:

If left(item.subject,3) = "RE:" or left(item.subject,3) = "FW:" then

Exit Sub

End if

See Outlook's Rules and Alerts: Run a Script - Slipstick Systems for more information and links to sample scripts.
 

susan_abc

Member
Outlook version
Outlook 2010 32 bit
Email Account
Exchange Server
The rules idea won't work (many of the emails have date/time stamp in the subject), but the script rule is intriguing. Thanks for the syntax!
 

Diane Poremsky

Senior Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
I was afraid a straight rule wouldn't work- although, maybe you don't need the full subject. But - outlook can sometimes outsmart you and overlook the Re or FW because its a reply or forward. (It does this with Out of Office replies.)
 

marius

Member
Outlook version
Outlook 2010 64 bit
Email Account
Exchange Server 2010
hi, with the help of your code i have now a code that moves non replyed email to another folder but it stoped working. it gives me error at For intCount = objSourceFolder.Items.Count To 1 Step -1 and i dont't know what i did to make it stop working . any help is welcomed. thank you.


'Use the GetFolderPath function to find a folder in non-default mailboxes
Function GETFOLDERPATH(ByVal FolderPath As String) As Outlook.folder
Dim oFolder As Outlook.folder
Dim FoldersArray As Variant
Dim i As Integer

On Error GoTo GetFolderPath_Error
If Left(FolderPath, 2) = "\\" Then
FolderPath = Right(FolderPath, Len(FolderPath) - 2)
End If
'Convert folderpath to array FoldersArray = Split(FolderPath, "\")
Set oFolder = Application.Session.Folders.Item(FoldersArray(0))
If Not oFolder Is Nothing Then
For i = 1 To UBound(FoldersArray, 1)
Dim SubFolders As Outlook.Folders
Set SubFolders = oFolder.Folders
Set oFolder = SubFolders.Item(FoldersArray(i))
If oFolder Is Nothing Then
Set GETFOLDERPATH = Nothing
End If
Next
End If
'Return the oFolder Set GetFolderPath = oFolder
Exit Function

GetFolderPath_Error:
Set GETFOLDERPATH = Nothing
Exit Function
End Function
Sub MoveNONREPLYEDdMail()

Dim objOutlook As Outlook.Application
Dim objNamespace As Outlook.NameSpace
Dim objSourceFolder As Outlook.MAPIFolder
Dim objDestFolder As Outlook.MAPIFolder
Dim objVariant As Variant
Dim intCount As Integer
Dim intDateDiff As Integer
Dim lngMovedItems As Long
Dim propertyAccessor As Outlook.propertyAccessor
Dim myForward As Outlook.MailItem
'On Error Resume Next
Set objOutlook = Application
Set objNamespace = objOutlook.GetNamespace("MAPI")
Set objSourceFolder = GETFOLDERPATH("Mailbox - Clients\Inbox\zile arhivare\Azi") 'sursa
'Set objSourceFolder = GETFOLDERPATH("Shared mailbox name\Inbox")
Set objDestFolder = GETFOLDERPATH("Mailbox - Clients\Inbox\zile arhivare\Ieri") 'destinatie
' use a subfolder under Inbox
For intCount = objSourceFolder.Items.Count To 1 Step -1
Set objVariant = objSourceFolder.Items.Item(intCount)
DoEvents
If objVariant.Class = olMail Then
Set propertyAccessor = objVariant.propertyAccessor

intDateDiff = DateDiff("d", objVariant.SentOn, Now)
If Not propertyAccessor.GetProperty("http://schemas.microsoft.com/mapi/proptag/0x10810003") = 102 _
And Not propertyAccessor.GetProperty("http://schemas.microsoft.com/mapi/proptag/0x10810003") = 103 Then
intDateDiff = DateDiff("d", objVariant.SentOn, Now)
If intDateDiff > -1 Then
objVariant.MOVE objDestFolder
lngMovedItems = lngMovedItems + 1
End If
End If
End If
Next
MsgBox "Au fost gasite " & lngMovedItems & " email-uri :) "
' Set objDestFolder = Nothing

End Sub
 

Michael Bauer

Senior Member
Outlook version
Outlook 2010 32 bit
Email Account
Exchange Server
If the error n0 is 91, then objSourceFolder is Nothing. That means GetFolderPath doesn't return a folder for the given path. If that's not the error, reveal what the err msg is saying.
 
Status
Not open for further replies.
Thread starter Similar threads Forum Replies Date
O Rule to move (specific) messages from Sent folder to Specific folder Using Outlook 1
D A way to create a rule to move messages to specific folder after read? Using Outlook 2
Nadine Rule to move attachments with specific name Outlook VBA and Custom Forms 1
K VBA BeforeItemMove event create rule to always move to its folder. Outlook VBA and Custom Forms 4
L Making rule to move email to folder from one O365 domain Using Outlook 1
S Send email via SMTP - use transport rules to add to senders inbox (then rule to move to sent items Exchange Server Administration 1
S How can I create a rule to move inbound emails from any of my contacts out of Inbox? Using Outlook 1
H Rule to move emails based on subject and content Outlook VBA and Custom Forms 1
B Outlook 2000 Rule to Move txt msg Not Working if size >24KB Using Outlook 3
S Creating custom rule to move if "NAME" is in body but ignore the phrase "Hi NAME" in the search Using Outlook 2
N rule to move sent mail to the deleted folder in outlook Using Outlook 4
H move to folder rule corrupts message Using Outlook 3
A rule to move emails to a folder then want to delete them from that folder 2010 Using Outlook 5
S Rule to move BCC email to a folder Using Outlook 6
P Create rule 'move to XYZ folder when sender does not contain mydomain.com' Using Outlook 2
N Move to folder rule still shows desktop alert Using Outlook 2
O Outlook 2010: Rule to move sent emails doesn't start if I Use "Send To" command on a file on desktop Using Outlook 3
R Move to folder rule for already downloaded emails Using Outlook 1
B Create a rule to move emails after being sent to specific domains Outlook 2007 Using Outlook 1
O How to set rule to move email from hotmail account into Inbox? Using Outlook 1
M Organization rule ***SPAM*** to move to specific folder Using Outlook 6
D How to create a rule to move a message after it is read Using Outlook 3
1 Incorrectly Setup a Rule at Domain level to not allow address from outside domain Exchange Server Administration 2
J Transport Rule to detect Keyword question.. Exchange Server Administration 2
T "Words In Recipient's Address" Rule Causes Outlook To Stop Processing Rules Using Outlook 3
R Outlook Autoforward rule do not work for NDR messages Using Outlook 1
R Setup autofoward rule on a particular folder in Outlook Using Outlook 0
N Rule for "on behalf of" - with changing names Using Outlook 2
S Unable to remove rule outlook 2010 Using Outlook 0
O Outlook 2016 This rule will only run when you check your email in Outlook.... Using Outlook 4
N Outlook Email Rule execution through shortcut keys (VBA codes) Using Outlook 1
dweller Outlook 2010 Rule Ignores VBA Script Outlook VBA and Custom Forms 2
S Adding new Exchange (2016) rule very slow down Microsoft Outlook Exchange Server Administration 0
B Outlook rule run a Script doesn't work Outlook VBA and Custom Forms 1
icacream Rule based on sender / wrong sender sent to folder Using Outlook 7
Bri the Tech Guy Run Script rule not running for newly arriving messages Outlook VBA and Custom Forms 25
J Assess content of User Defined Field in Rule Using Outlook 3
A Change order of actions in one (!) rule Outlook VBA and Custom Forms 2
J HELP- Rule to auto strip prepend from external emails Using Outlook 0
A Forward Outlook Email by Filtering using Macro Rule Outlook VBA and Custom Forms 44
A rule to flag messages not working Using Outlook 5
Brian Murphy Exchange Online Everything a Transport Rule should do and cannot Exchange Server Administration 1
J Outlook Rules - Changing auto-submit address in multiple rules, according to rule name Outlook VBA and Custom Forms 0
A saving attachement to folder named the same as rule name Outlook VBA and Custom Forms 0
Jennifer Murphy Can I create a Rule with Or'd conditions? Using Outlook 1
A Rules - how to determine if all conditions in rule are true or false Outlook VBA and Custom Forms 5
Vijay Error in rule- Run a script Using Outlook 1
Ascar_CT Rule behavior analysis - any tools available? Using Outlook 0
Liza Creating a rule in outlook to filter messages Using Outlook 0
Stilgar Relsik Create a rule to copy text from an email and paste it in the subject line. Using Outlook 1
Similar threads


















































Top