Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Outlook / Programming VBA / March 2004

Tip: Looking for answers? Try searching our database.

Please help - code to move messages?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Barbara - 30 Mar 2004 19:14 GMT
Hi!

I am currently working in an environment which is using Exchange
Server and relies heavily on email messages, consequently everyone
sends and receives masses of mail.

Unfortunately, as it is a charity, it is screwed down so tightly
against viruses and hackers that we are prevented from loading
programs or addins.
However, it is possible to write code.

I would like to relieve the pressure in my Boss's InBox by using code
to set up a custom rule (or similar) to move read messages to folders
stipulated by the user.

I am very new to programming Outlook and have recently started making
my way through Sue Mosher's book 'Microsoft Outlook Programming', but
it is a slow process, I haven't come up with anything yet and the
pressure is on me to come up with something.

I would very much appreciate your help and/or suggestions.

Many Thanks

Barbara (^-^)/

UK
Ken Slovak - [MVP - Outlook] - 31 Mar 2004 15:43 GMT
You could handle the ItemChange event for the Items collection of the Inbox
folder. When an item is changed you get a handle to the item and can use
that to check the UnRead property. If it's False you can then move the item
to another folder.

I don't recall any specific ItemChange code but it's very similar to ItemAdd
code. Look at the ZapHTML code sample at
http://www.outlookcode.com/d/code/zaphtml.htm#cw to see how to set up an
ItemAdd handler. You can modify that to produce an ItemChange handler.

Signature

Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm

> Hi!
>
[quoted text clipped - 23 lines]
>
> UK
B M - 31 Mar 2004 19:52 GMT
Thank you *so* much for your suggestion. I'll try it out.

Barbara (^-^)/
brigsoft - 31 Mar 2004 21:30 GMT
Move is the method of MailItem, Unread is its parameter.
For Each oNewItem In Folder.Items.Restrict("[Unread] = 0")

oNewItem.Move ... etc
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.