![]() |
If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
![]()
Hello,
MS OUTLOOK 2003 on XP PRO. What I'm trying to do: I want to take every email I send, move it to a PST folder, and mark as read using VBA since this isn't possible in a rule (specifically mark as read). My Problem: Through this forum and some other places, I think I have code that's at least close to doing this. The problem is, the darn thing never triggers. Please help me with this code. Thank you. All of what follows is the entirety of a class module. Dim myolApp As New Outlook.Application Public WithEvents myOlItems As Outlook.Items Public Sub Initialize_handler() Set myOlItems = myolApp.GetNamespace("MAPI").GetDefaultFolder(olFo lderSentMail).Items End Sub Public Sub myOlItems_ItemAdd(ByVal Item As Object) Dim myInbox As Outlook.MAPIFolder Dim myFolder As Outlook.MAPIFolder Dim myNewFolder As Outlook.MAPIFolder Set myFolder = myNameSpace.GetDefaultFolder(olFolderSentMail) Set myInbox = myNameSpace.GetDefaultFolder(olFolderInbox) Set myNewFolder = myInbox.Folders("EMAIL") Item.Move myNewFolder Item.UnRead = False Item.Save Debug.Print Item.Subject End Sub -- BlueWolverine MSE - Mech. Eng. Go BLUE! |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
ItemAdd event fires more than once when adding a new appointment | Johan Machielse[_2_] | Add-ins for Outlook | 1 | July 22nd 08 12:11 PM |
(VSTO SE) folder.Items.ItemAdd Event does not fire | David | Outlook and VBA | 5 | March 7th 07 08:41 PM |
ItemAdd in Deleted Items event doesnt fire after a while | [email protected] | Add-ins for Outlook | 11 | January 8th 07 08:27 AM |
ItemAdd in Deleted Items event doesnt fire after a while | SHUperb | Outlook - Calandaring | 0 | January 5th 07 07:41 AM |
ItemAdd event with Outlook2007 | DavidH&P | Outlook - Using Forms | 2 | July 4th 06 08:29 AM |