
Signature
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx
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
> See http://www.outlookcode.com/codedetail.aspx?id=959 for sample code.
>
[quoted text clipped - 4 lines]
> > Thanks,
> > Steve
Sue Mosher [MVP-Outlook] - 06 Oct 2005 19:33 GMT
Does other VBA code run? Did you check your macro security settings in Tools | Macro | Security?
If you're new to Outlook VBA macros, these web pages should help you get started:
http://www.winnetmag.com/Articles/Index.cfm?ArticleID=21522&pg=1
http://www.outlookcode.com/d/vb.htm

Signature
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx
>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
[quoted text clipped - 15 lines]
>> > Thanks,
>> > Steve
David C. Holley - 07 Oct 2005 00:12 GMT
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.
> 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
[quoted text clipped - 15 lines]
>>>Thanks,
>>>Steve
Sue Mosher [MVP-Outlook] - 07 Oct 2005 00:43 GMT
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.

Signature
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx
> Outlook VBA help has the tools to get you started. You'll want to look
> under the following subjects for actual code examples...
[quoted text clipped - 39 lines]
>>
>>>See http://www.outlookcode.com/codedetail.aspx?id=959 for sample code.
>>>>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