Solved

Outlook Rule, just for 1 word in the subject not contains

Posted on 2009-03-31
10
616 Views
Last Modified: 2012-05-06
Hello,

I want to create a rule so e-mails JUST with the word "Start" are forwarded.

So for example if I send an e-mail with the subject "Start" it works the rule
If I send an example with the e-mail subject "The Start" then it won't use the rule
0
Comment
Question by:ShockUK
  • 7
  • 2
10 Comments
 
LVL 40

Expert Comment

by:coolsport00
ID: 24028961
I'm pretty sure this isn't possible; Outlook isn't that granular in its rules. The only thing I can suggest is to create your rule, then on the 'Exceptions', select 'specific words in the subject' and add all other "Start..." combinations that you can think of. That is a bit tedious to be sure, but I don't think there is any other way to do what you're wanting.

Regards.
~coolsport00
0
 
LVL 59

Expert Comment

by:Chris Bottomley
ID: 24029547
Yes we can do this, are you comfortable and permitted to use VBA?

Chris
0
 
LVL 59

Expert Comment

by:Chris Bottomley
ID: 24029579
Apologies I wasn't clear, yes we can detect the condition the 'rule' activity will also have to be in teh code but yes within that constraint.

Chris
0
Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

 

Author Comment

by:ShockUK
ID: 24029586
Yea,
I've used VBA for Excel & Access
0
 
LVL 59

Expert Comment

by:Chris Bottomley
ID: 24029601
And for your info it'll look something like:

Chris
Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
    If lcase(Item.subject) = "start" Then
        ' do something with VBA
    End If
End Sub

Open in new window

0
 
LVL 59

Expert Comment

by:Chris Bottomley
ID: 24029618
WHat do you want to happen in the specific case that the subject = start>

Chris
0
 

Author Comment

by:ShockUK
ID: 24029630
Thats great, I will give it ago in the morning.

The the " 'do something with VBA" how would I make it put the e-mail into Folder "Start"
0
 
LVL 59

Expert Comment

by:Chris Bottomley
ID: 24029671
Do you want to cancel the send or simply make it save the sent item in the folder start?  Also can you identify the path for folder start and i'll put something together:

In outlook put the cursor on the folder start then in the VBE immediate window type:

?application.ActiveExplorer.CurrentFolder.FolderPath

And let me know the path

Chris
0
 
LVL 59

Accepted Solution

by:
Chris Bottomley earned 500 total points
ID: 24029759
Assuming you want to force the sent message save to folder then:

Chris
Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
    If LCase(Item.subject) = "start" Then
        Set Item.SaveSentMessageFolder = olNav2Folder("\\Personal Folders\Inbox\Experts Exchange\Answers")
    End If
End Sub
Public Function olNav2Folder(foldername As String, Optional createFolders As Boolean) As Object
Dim olApp As Object
Dim olNs As Object
Dim olfldr As Object
Dim reqdFolder As Object
Dim arrFolders() As String
Dim nestCount As Integer
 
    On Error Resume Next
    foldername = Replace(Replace(foldername, "/", "\"), "\\", "")
    If Right(foldername, 1) = "\" Then foldername = Left(foldername, Len(foldername) - 1)
    arrFolders() = Split(foldername, "\")
    Set olApp = CreateObject("Outlook.Application")
    Set olNs = olApp.GetNamespace("MAPI")
    Set reqdFolder = olNs.folders.Item(arrFolders(0))
    For nestCount = 1 To UBound(arrFolders)
        If Not reqdFolder Is Nothing Then
            Set olfldr = reqdFolder.folders
            Set reqdFolder = olfldr.Item(arrFolders(nestCount))
            If reqdFolder <> olfldr.Item(arrFolders(nestCount)) Then
                If createFolders Then
                    reqdFolder.folders.Add (arrFolders(nestCount))
                    Set olfldr = reqdFolder.folders
                    Set reqdFolder = olfldr.Item(arrFolders(nestCount))
                Else
                    Set reqdFolder = Nothing
                    Exit For
                End If
            End If
        Else
        End If
    Next
    Set olNav2Folder = reqdFolder
    Set olApp = Nothing
    Set olNs = Nothing
    Set olfldr = Nothing
    Set reqdFolder = Nothing
End Function

Open in new window

0
 
LVL 59

Expert Comment

by:Chris Bottomley
ID: 24029767
Modify the line:

        Set Item.SaveSentMessageFolder = olNav2Folder("\\Personal Folders\Inbox\Experts Exchange\Answers")

to replace:
\\Personal Folders\Inbox\Experts Exchange\Answers
with the string obtained from the VBE.

Chris
0

Featured Post

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Resolve DNS query failed errors for Exchange
In this step by step procedure, you will come to know the details of creating an Outlook meeting in 2007, 2010, 2013 & 2016.
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
Many of my clients call in with monstrous Gmail overloading issues with Outlook. A quick tip is to turn off the All Mail and Important folders from synching. Here is a quick video I made to show you how to turn off these and other folders in Gmail s…

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question