• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 247
  • Last Modified:

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?
0
varesources
Asked:
varesources
  • 3
1 Solution
 
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

0
 
Helen FeddemaCommented:
Here is some very basic code:
0
 
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
   tsk.Display
   
ErrorHandlerExit:
   Exit Sub

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

End Sub

Open in new window

0
 
cornetthdCommented:
It can be done by dragging and dropping the email on the task list.

http://www.priacta.com/troblog/2008/05/14/training/create-tasks-from-outlook-emails/
0

Featured Post

Free tool for managing users' photos in Office 365

Easily upload multiple users’ photos to Office 365. Manage them with an intuitive GUI and use handy built-in cropping and resizing options. Link photos with users based on Azure AD attributes. Free tool!

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now