Thread
:
Creating a link to an e-mail in a task
View Single Post
#
2
November 14th 06, 07:03 AM posted to microsoft.public.outlook.program_vba
Michael Bauer [MVP - Outlook]
external usenet poster
Posts: 1,885
Creating a link to an e-mail in a task
You can add the e-mail to the task's Attachments.
--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
--
www.VBOffice.net
--
Am 13 Nov 2006 01:42:46 -0800 schrieb
:
I want to create a task from an incoming e-mail such that the task
contains a link to the e-mail.
Right now I have this:
Sub creTask_as_WaitingFor()
Dim objApp
Dim objItem
Dim objTask
Dim myRecTime As String
Dim myTimeString As String
Dim myToString As String
' Get current item
Set objApp = CreateObject("Outlook.Application")
Set objItem = objApp.ActiveInspector.CurrentItem
' Format stuff - formatting is in Swedish so may look weird
myRecTime = CStr(objItem.ReceivedTime)
myTimeString = Mid(myRecTime, 9, 2) & Mid(myRecTime, 4, 2) &
Mid(myRecTime, 1, 2)
myToString = Replace(CStr(objItem.SenderName), "'", "")
' Create task and set fields
Set objTask = objApp.CreateItem(olTaskItem)
objTask.Subject = myToString & " - " & myTimeString & " - " &
objItem.Subject
objTask.Body = objItem.Body
objTask.ReminderSet = False
objTask.Categories = "5 - Waiting For"
objTask.Save
End Sub
This works well. It creates a task, sets the body to the body of the
e-mail, sets the subject etc.
However, when I open the task, I want it to have a link to the original
e-mail or a copy of the e-mail in the task or something similar, so
that I can reply to the e-mail without having to find it manually. It
doesn't matter much if it's actually a link or a copy. The idea is just
that I should be able to reply to the e-mail as quickly as possible
from the task.
If I manually drag the e-mail from the current folder and drop it on
the task, I will get the e-mail in the task, but I haven't figured out
how to do that programmatically.
Michael Bauer [MVP - Outlook]
View Public Profile
View message headers
Find all posts by Michael Bauer [MVP - Outlook]
Find all threads started by Michael Bauer [MVP - Outlook]
Ads