Outlook- Email to Task in a Specified Task List within To Do
Hello
Thank you for taking the time to read this. I followed this article here
[https://www.slipstick.com/outlook/rules/create-task-email-rule/
Brilliant and works well - I reached out to the author but I was unsuccessful. Essentially the rule in Outlook runs a script to say if the email subject matches x it creates a task (with any attachments, and a link to the email) I'm stuck at the next part --> and moves it to a specified "task list" in "to do" I can't seem to send it to a specific task list.
Sub ConvertMailtoTask(Item As Outlook.MailItem)
Dim objTask As Outlook.TaskItem
Set objTask = Application.CreateItem(olTaskItem)
With objTask
.Subject = Item.Subject
.StartDate = Item.ReceivedTime
.Body = Item.Body
Dim newAttachment As Outlook.Attachments
Set newAttachment = objTask.Attachments
newAttachment.Add Item, olEmbeddeditem
If Item.Attachments.Count > 0 Then
CopyAttachments Item, objTask
End If
.Save
End With
Set objTask = Nothing
End Sub
Sub CopyAttachments(objSourceItem, objTargetItem)
Set fso = CreateObject("Scripting.FileSystemObject")
Set fldTemp = fso.GetSpecialFolder(2) ' TemporaryFolder
strPath = fldTemp.Path & "\"
For Each objAtt In objSourceItem.Attachments
strFile = strPath & objAtt.FileName
objAtt.SaveAsFile strFile
objTargetItem.Attachments.Add strFile, , , objAtt.DisplayName
fso.DeleteFile strFile
Next
Set fldTemp = Nothing
Set fso = Nothing
End Sub
The rule should move the email to a Custom List name (sales tasks, marketing tasks etc)
Any assistance would be appreciated.