Action on New Mail

K

Kev

I want a form to pop up with new mail with 4 options; Defer, Delete, Deal,
Delegate.

If I select Defer, I want it to create an task with the email as a copied
link.
If I select Delete, I want to delete it.
If I select Deal, I want to display the email.
I I select Delegate, I want it to create a task, ask me who to delegate it
to and send this to the delegated with the email as a link.

Where would I start with something like this.
 
S

Sue Mosher [MVP-Outlook]

What do you mean by "form to pop up with new mail"? I can imagine several
possibilities, the most likely being that you want to see a VBA userform.
Your Outlook version might also be useful to know.
--
Sue Mosher, Outlook MVP
Outlook and Exchange solutions at http://www.slipstick.com
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
K

Kev

Yes a VBA userform. Outlook version is 2003. Any help including code would
be appreciated.

Kev.
 
S

Sue Mosher [MVP-Outlook]

Do you want this to work on just some messages or all? (If all, the
complexity increases a couple of notches.)

Have you worked with VBA at all? Any other programming experience?

--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
K

Kev

Sue,

Yes every message if possible.

I have worked with VBA a little. I have a grounded understanding of the
syntax, i.e. I can follow a peice of code logically. I'm not sure where you
would start with something like this. There is a VBScript editor behind the
custom forms. There is 'ThisOutlookSession' in the VBA part??

A start would be desirable.

Regards,

Kev.
 
S

Sue Mosher [MVP-Outlook]

Yes, ThisOutlookSession is the built-in class module in Outlook VBA where
you can start building application-level code. Custom forms are irrelevant
to your project.

I'd probably approach it like this:

1) Build a VBA userform with a button for each of the actions you want to
take and a multi-column list box to list the newly arrived messages. This
list box needs at least two columns -- one to show the subject and one
hidden to store the item's EntryID. WHether you want more columns is up to
you.

2) Use the MAPIFolder.Items.ItemAdd event to monitor the Inbox for new
items, as shown at http://www.outlookcode.com/d/code/zaphtml.htm. For each
new item that arrives, you'd want to show the userform if it's not already
visible and add the latest item to the items in the list box -- both the
Subject and EntryID.

3) Put code behind each of the buttons on the userform in #1 to get the
EntryID of the user-selected message, then use the Namespace.GetItemFromID
method to get the selected item. From there, the code for the button would
do whatever that button is supposed to do with that item.

As you can see, this is not necessarily a simple project.

--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
K

Kev

ok, I have built the form and have a high level idea of how it works. Is
there any more code samples that you can give to help me on my way?

Kind Regards,

Kev.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top