Auto Create Tasks

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Is there a way to write a macro that will automatically create a taks from an
inbound e-mail. I am running a small help desk with an e-mail account for
the help desk. I want to create a taks for every incoming e-mail.

Thanks,
Steve
 
I pulled the sample code and opened up the VB editor in Outlook 2003.
Alt+F11. I have tried creating it as a module and as a class. I then create
a rule and the script is available. Nothing seems to work.

The code looks simple enough but I am inexperienced with adding it to
outlook. Do you have other resources for how I am supposed to set it up in
the VB editor or am I going at it the wrong way?

Thanks again.
Steve
 
Outlook VBA help has the tools to get you started. You'll want to look
under the following subjects for actual code examples...

MicroSoft Outlook Visual Basic Reference
Microsfot Outlook Object Model
Objects
M
*MailItem Object*
T
*TaskItem Object*
Events
N
*NEW MAIL EVENT*

The NEW MAIL EVENT fires when new mail is received in the mailbox.
To create a new TaskItem you would use the CreateItem method as in

Set myOlApp = CreateObject("Outlook.Application")
Set myItem = myOlApp.CreateItem(olTaskItem)

You would execute that code in the NEW MAIL EVENT to create the new Task
Item. Once the TaskItem is created, then its just a matter of setting
its properties to the those of the MailItem received in order to 'copy'
the information over. You can also set assorted properties like
importance, categories and/or assign a due date. I'll need to snoop
around for code that identifies the actual new mail item received, but
that should get you started.

FYI - The code would exist in the ThisOutlook module, as such you'd have
to copy the code to each machine on which it should run.
 
The problem with the NewMail event is that it doesn't tell you which item is new. The code sample I suggested uses a "run a script" rule to fire a VBA procedure that has the new MailItem as its parameter.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
Back
Top