Change OL message to task, then open it?
In addition to what? So far, your code does nothign to turn the items to
TaskItems.
If you want to keep the e-mails and want them additionally as tasks then you
have to create new TaskItems with the CreateItem function, and then copy
every property to it.
If you don't need the e-mail anymore and want to have them displayed as
TaskItems then simply change the MessageClass property. By that property
Outlok decides what form to use.
Sorry - this is all very new to me. I want to accomplish one simple thing,
and I'm finding myself having to learn an entire programming language to
essentially run a three-click macro.
Come on, that a user has to do one click to perform an action tells that the
code behind the scenes might be very smart, not that it's simple to write.
But you can relax, when you have finished the code you're still years away
from having learned the entirely progamming language.
--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
Organize eMails:
http://www.vboffice.net/product.html?id=2006063&cmd=detail&lang=en&pub=6
Am Mon, 1 Oct 2007 16:56:02 -0700 schrieb NHedley:
Is there a smarter way? Would changing MessageClass be *in addition* to
everything else? Or simply *instead of*?
Sorry - this is all very new to me. I want to accomplish one simple
thing,
and I'm finding myself having to learn an entire programming language to
essentially run a three-click macro.
Thanks.
"Michael Bauer [MVP - Outlook]" wrote:
If you want to turn the e-mail into a task without creating a nw item
then
change its MessageClass property to 'IPM.Task'.
BTW: Your MoveMessages method doesn't work if you really have more than
one
item selected. Then you'd have to loop backwards.
--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
Organize eMails:
http://www.vboffice.net/product.html?id=2006063&cmd=detail&lang=en&pub=6
Am Sun, 30 Sep 2007 17:33:00 -0700 schrieb NHedley:
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.
|