![]() |
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
|
|||
|
|||
![]()
I'm trying to automate my Outlook mailbox so when a task appears in my inbox
with the subject starting with "Please consider" that it is moved to my task folder named "AAA". My direction is that I've created an Outlook Rule whose criteria is having "Please consider" in the subject and then it runs a script. The script needs to move the task for me, but this is where I'm having problems since I'm limited to what I know. Below is my snippet which only works if I go into the task folder, highlight all the entries and run the code. Sub MoveTaskToFolder() On Error Resume Next Dim objFolder As Outlook.MAPIFolder, objInbox As Outlook.MAPIFolder Dim objNS As Outlook.NameSpace, objItem As Outlook.TaskItem Set objNS = Application.GetNamespace("MAPI") Set objInbox = objNS.GetDefaultFolder(olFolderInbox) Set objFolder = objInbox.Parent.Folders("AAA") For Each objItem In Application.ActiveExplorer.Selection If objFolder.DefaultItemType = olTaskItem Then objItem.Move objFolder End If Next Set objItem = Nothing Set objFolder = Nothing Set objInbox = Nothing Set objNS = Nothing End Sub Can anyone help me with this. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
2 simple macros - create task from email and move email to folder | [email protected] | Outlook and VBA | 5 | February 4th 07 09:57 AM |
How do I move a Daily Task to the Master Task List? | Carol | Outlook - General Queries | 0 | November 17th 06 05:57 PM |
Can not open "task request" "task accepted" in Inbox | LaParker | Outlook - General Queries | 2 | August 9th 06 10:09 PM |
Task 'Hotmail: Folder:Inbox Synchronizing headers.' reported error (0x80004005) | baduser | Outlook - General Queries | 4 | July 21st 06 09:46 AM |
VBA Code to check Task Status | [email protected] | Outlook and VBA | 2 | February 3rd 06 06:16 PM |