M
Murphybp2
I am trying to create a process where when I send a message that I
want to be sure to follow up on, I cc myself on the message. I want
to then take that incoming message, copy it to a task and populate
certain fields on the task, then delete the message. I am currently
trying to run the script after a rule identifies the message. If
there is a better way of doing it, I'm open to suggestions. Below is
the script I have, but it's not working, and I can't figure out what
the problem is. Any help would be appreciated.
Sub CopyIncomingEmailtoWaitingForTask(Item As Outlook.MailItem)
'Use this to tie to a Rule that automatically creates task for Waiting
Items on Incoming items I copied myself on
Dim olmailitem As Outlook.MailItem
Dim ti As TaskItem
Dim fldCurrent As MAPIFolder
Set fldCurrent =
Application.GetNamespace("MAPI").GetFolderFromID("00000000FB410B46958BD711B21100805FA730C90100F8C9907DFE3BD611B20400805FA730C90000064BAD4F0000")
Set ti = fldCurrent.Items.Add
ti.Body = olmailitem.Body & vbCrLf & vbCrLf
ti.Attachments.Add MailItem
ti.Subject = olmailitem.SenderName & olmailitem.Subject &
olmailitem.SentOn
ti.Categories = "@Waiting For"
olmailitem.Move
Application.GetNamespace("MAPI").GetFolderFromID("00000000FB410B46958BD711B21100805FA730C90100F7CBF61AE174914C9E364B416FA0A91600000154A1DB0000")
ti.Save
End Sub
want to be sure to follow up on, I cc myself on the message. I want
to then take that incoming message, copy it to a task and populate
certain fields on the task, then delete the message. I am currently
trying to run the script after a rule identifies the message. If
there is a better way of doing it, I'm open to suggestions. Below is
the script I have, but it's not working, and I can't figure out what
the problem is. Any help would be appreciated.
Sub CopyIncomingEmailtoWaitingForTask(Item As Outlook.MailItem)
'Use this to tie to a Rule that automatically creates task for Waiting
Items on Incoming items I copied myself on
Dim olmailitem As Outlook.MailItem
Dim ti As TaskItem
Dim fldCurrent As MAPIFolder
Set fldCurrent =
Application.GetNamespace("MAPI").GetFolderFromID("00000000FB410B46958BD711B21100805FA730C90100F8C9907DFE3BD611B20400805FA730C90000064BAD4F0000")
Set ti = fldCurrent.Items.Add
ti.Body = olmailitem.Body & vbCrLf & vbCrLf
ti.Attachments.Add MailItem
ti.Subject = olmailitem.SenderName & olmailitem.Subject &
olmailitem.SentOn
ti.Categories = "@Waiting For"
olmailitem.Move
Application.GetNamespace("MAPI").GetFolderFromID("00000000FB410B46958BD711B21100805FA730C90100F7CBF61AE174914C9E364B416FA0A91600000154A1DB0000")
ti.Save
End Sub