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

Change OL message to task, then open it?



 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old October 1st 07, 01:33 AM posted to microsoft.public.outlook.program_vba
NHedley
external usenet poster
 
Posts: 4
Default Change OL message to task, then open it?

What I've done is uninstall the David Allen "Getting Things Done" Add-In,
because it doesn't play nice with the Project Web Access Add-In. So here's
the main functionality from GTD I'm trying to replace...I'd like to be able
to take a message from any folder (mostly my Inbox), and with one click on
the toolbar, mark it as read, convert it to a task, and open the resulting
task form so I can edit categories, dates and such.

Here's what I have so far (borrowed and stolen from around the 'net), and it
works like a charm. Obviously, it doesn't open the task form, because
everything I've tried opens the original email, not the task.

snip

Sub MoveMessages(strFolder As String)
Dim olkItem As Object, _
olkFolder As Outlook.MAPIFolder
Set olkFolder = OpenMAPIFolder(strFolder)
If TypeName(olkFolder) = "MAPIFolder" Then
For Each olkItem In Application.ActiveExplorer.Selection
olkItem.UnRead = False
olkItem.Save
olkItem.Move olkFolder
Next
End If
Set olkFolder = Nothing
Set olkItem = Nothing
End Sub
Sub CreateTask()
MoveMessages "\Personal Folders\Tasks"
End Sub
Function OpenMAPIFolder(szPath)
Dim app, ns, flr, szDir, i
Set flr = Nothing
Set app = CreateObject("Outlook.Application")
If Left(szPath, Len("\")) = "\" Then
szPath = Mid(szPath, Len("\") + 1)
Else
Set flr = app.ActiveExplorer.CurrentFolder
End If
While szPath ""
i = InStr(szPath, "\")
If i Then
szDir = Left(szPath, i - 1)
szPath = Mid(szPath, i + Len("\"))
Else
szDir = szPath
szPath = ""
End If
If IsNothing(flr) Then
Set ns = app.GetNamespace("MAPI")
Set flr = ns.Folders(szDir)
Else
Set flr = flr.Folders(szDir)
End If
Wend
Set OpenMAPIFolder = flr
End Function

Function IsNothing(obj)
If TypeName(obj) = "Nothing" Then
IsNothing = True
Else
IsNothing = False
End If
End Function

/snip

Anyone? Bueller?

The above move multiple messages at a time; that functionality isn't
critical to me, as I tend to process everything as it arrives; but someone
else might have a need to move a large number of items all at once.

Thanks in advance for any advice.
 




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
how do I change a calendar appointment to a task? jc Outlook - Calandaring 1 July 24th 07 04:31 PM
How do I change task ownership? Jake Outlook - Installation 0 June 10th 07 07:06 PM
change task due dates default jaelde Outlook - Calandaring 1 July 11th 06 09:45 AM
How to change the Task Default Window..... Christi Outlook - General Queries 1 June 19th 06 07:47 PM
Task bar refresh with calendar change fetch98 Outlook - Calandaring 0 January 19th 06 08:59 PM


All times are GMT +1. The time now is 10:30 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.