Solved

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

Posted on 2009-03-31
10
614 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
Comment Utility
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
Comment Utility
Yes we can do this, are you comfortable and permitted to use VBA?

Chris
0
 
LVL 59

Expert Comment

by:Chris Bottomley
Comment Utility
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
 

Author Comment

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

Expert Comment

by:Chris Bottomley
Comment Utility
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
Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

 
LVL 59

Expert Comment

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

Chris
0
 

Author Comment

by:ShockUK
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

My experience with Windows 10 over a one year period and suggestions for smooth operation
Find out how to use dynamic social media in email signatures with this top 10 DOs & DON’Ts.
To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…
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: …

762 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now