How do I make a rule that creates a task after an email is received?

We have a distribution group that receives emails from a certain email address. When an email is received we want Outlook to automatically make it a task and when that task is completed everyone in the distribution group is notified. How do I do this?
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Helen FeddemaCommented:
You can write code on the Application_NewMail event to check the incoming emails for (say) a distinctive Subject line, and create a task picking up information from those emails.  Unfortunately, the Application_NewMail event lacks an argument for the new item, so you have to use something like this code to get a reference to it:

fld.Items.Sort "Received", False
Set msg = fld.Items.GetFirst

Open in new window

Helen FeddemaCommented:
Here is some very basic code:
Helen FeddemaCommented:
Somehow it didn't get uploaded.  Here it is again
Private Sub Application_NewMail()
'Created by Helen Feddema 5-Apr-2010
'Last modified by Helen Feddema 5-Apr-2010

   Dim nms As Outlook.NameSpace
   Dim fld As Outlook.MAPIFolder
   Dim msg As Outlook.MailItem
   Dim tsk As Outlook.TaskItem
   Set nms = Application.GetNamespace("MAPI")
   Set fld = nms.GetDefaultFolder(olFolderInbox)

   fld.Items.Sort "Received", False
   Set msg = fld.Items.GetFirst
   Set tsk = Application.CreateItem(olTaskItem)
   tsk.Subject = msg.Subject
   Exit Sub

   MsgBox "Error No: " & Err.Number _
      & " in Application_NewMail procedure; " _
      & "Description: " & Err.Description
   Resume ErrorHandlerExit

End Sub

Open in new window


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It can be done by dragging and dropping the email on the task list.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.