A Microsoft Outlook email forum. Outlook Banter

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.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Move Email from inbox after a certain time period, with other criteria, to Personal Folders



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old January 23rd 07, 06:27 PM posted to microsoft.public.outlook.program_vba
Murphybp2
external usenet poster
 
Posts: 26
Default Move Email from inbox after a certain time period, with other criteria, to Personal Folders

I have some macros I would like to create to automate the movement of
emails. But I am not that good with Outlook VBA. Here is what I'd
like to do.

Move Certain Sent Items to Personal Folder (When I start Outlook)

- I want it move all of the Sent Items in my Sent Folder, that are over
7 days old, and have a read receipt that's been processed, to my
personal folders. (I do know how to use a macro to get the folder ID)
- Move all Sent Items from my Sent folder, that are over 21 days old to
my personal folders.


Any help would be appreciated.

Ads
  #2  
Old January 23rd 07, 08:05 PM posted to microsoft.public.outlook.program_vba
Eric Legault [MVP - Outlook]
external usenet poster
 
Posts: 830
Default Move Email from inbox after a certain time period, with other crit

Moving e-mails from the Sent Items folder if the corresponding recipient has
released a read receipt you have received is too difficult to write quickly,
but it is possible.

You can start by using the Application_Startup event in the
ThisOutlookSession module. Call your procedure from there to automatically
process items in your Sent Items folder. If you have the folder ID, you can
use the MAPIFolder.Items property to return an Items collection object that
you can call the Restrict method on, using a filter as an argument to that
method:

E.g. To filter for items received after January 15, 1999 at 3:30 P.M.:

sFilter = "[ReceivedTime] '" & Format("1/15/99 3:30pm", "ddddd h:nn AMPM")
& "'"

You'll need to use some DateDiff functions to customize the filter to look
for X days beforehand. You can then iterate through the Items collection and
call Item.Move(DestFolder).

To take it all the way, use the ItemAdd event for an Items object retrieved
from the Inbox's MAPIFolder object (use NameSpace.GetDefaultFolder) declared
WithEvents. You can use the Item argument in that event to look for read
receipts and compare the subject or recipient or message body against
messages in the Sent Items folder.

--
Eric Legault (Outlook MVP, MCDBA, MCTS: Messaging & Collaboration)
Try Picture Attachments Wizard for Outlook:
http://www.collaborativeinnovations.ca
Blog: http://blogs.officezealot.com/legault/


"Murphybp2" wrote:

I have some macros I would like to create to automate the movement of
emails. But I am not that good with Outlook VBA. Here is what I'd
like to do.

Move Certain Sent Items to Personal Folder (When I start Outlook)

- I want it move all of the Sent Items in my Sent Folder, that are over
7 days old, and have a read receipt that's been processed, to my
personal folders. (I do know how to use a macro to get the folder ID)
- Move all Sent Items from my Sent folder, that are over 21 days old to
my personal folders.


Any help would be appreciated.


 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Using the main Inbox/Personal Folders for my E-mail connection. Frankie Bovino Outlook - Installation 3 October 4th 06 02:02 AM
Move Personal Folders Up or Down Doug Recla Outlook - General Queries 2 May 27th 06 03:45 PM
move inbox & merge archive folders? ny_dancer Outlook - General Queries 1 April 22nd 06 12:37 AM
Cannot Move IMAP Emails From Inbox To Folders Anymore JC Outlook Express 1 March 31st 06 08:41 PM
MS Outlook 2003 Email remains in Outbox for extend period of time AV IT Support Outlook - General Queries 1 February 5th 06 12:40 AM


All times are GMT +1. The time now is 10:24 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.