The purpose of the code is to create a copy of the selected message as a task form.
The problem: I don't now how to use the selected message property. At the moment I copy the body of a specified message item (Item (2) in the example below) and not the message selected by the user at the time.
This code is run from a custom button on the toolbar of the main outlook explorer window and the opened message window.
My code:
Code:
Sub DisplayForm()
Set myMailFolder = Session.GetDefaultFolder(olFolderInbox)
Set myMailItem = myMailFolder.Items(2)
Set myTaskFolder = Session.GetDefaultFolder(olFolderTasks)
Set myItem = myTaskFolder.Items.Add("IPM.Task")
With myItem
.Subject = myMailItem.Subject
.Body = myMailItem.Body
End With
myItem.Display
End Sub
Ps. Our exchange mail server is 3rd pary software and does not support custom forms. The custom actions on the design forms function does therefore not work. I have to do it in vbscript.
Thanks.