A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Creating a link to an e-mail in a task



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old November 13th 06, 10:42 AM posted to microsoft.public.outlook.program_vba
[email protected]
external usenet poster
 
Posts: 1
Default Creating a link to an e-mail in a task

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.

Ads
  #2  
Old November 14th 06, 07:03 AM posted to microsoft.public.outlook.program_vba
Michael Bauer [MVP - Outlook]
external usenet poster
 
Posts: 1,885
Default 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.

 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
link task or email to contact in outlook 2007 mikem Outlook - Using Contacts 4 September 18th 06 11:59 PM
Creating an Outlook Task Add-in Solution using AdvancedSearch in C Tom_in_Atlanta Add-ins for Outlook 2 September 12th 06 03:14 AM
Help with Code - Creating Status Report from Task items Steve Outlook and VBA 1 August 2nd 06 06:45 AM
Creating Task sometimes collapses group T. Wise Outlook - General Queries 3 July 14th 06 05:46 AM
Link a task to another task gary Outlook and VBA 1 January 10th 06 05:21 PM


All times are GMT +1. The time now is 07:12 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.