Consulting

Results 1 to 3 of 3

Thread: Create outlook rule for email with case-sensitive subject

  1. #1

    Create outlook rule for email with case-sensitive subject

    I need to create a rule in outlook using Macro so that emails having subject line as "Test" go to Test1 folder and emails with subject line "TEST" will go to Test2 folder. How do I create rule for this scenario? Any inputs on this are greatly appreciated. Thanks.
    Sincerely

  2. #2
    Can somebody please help?

  3. #3
    You can do it with a rule with a script. The following should work

    Sub MoveBySubject(olItem As Outlook.MailItem)
    Dim strfolder As String
        With olItem
            Select Case .Subject
                Case "Test": strfolder = "Test1"
                Case "TEST": strfolder = "Test2"
                Case Else: GoTo lbl_Exit
            End Select
        End With
        olItem.Move Session.GetDefaultFolder(olFolderInbox).folders(strfolder)
    lbl_Exit:
        Exit Sub
    End Sub
    Please note that this is not a help desk. The users here are volunteers, based all over the world, who respond when they are able. It doesn't require a reminder after only 43 minutes.
    Graham Mayor - MS MVP (Word) 2002-2019
    Visit my web site for more programming tips and ready made processes
    http://www.gmayor.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •