Outlook Rules based on number of days

  • Thread starter Thread starter IpcTrain
  • Start date Start date
I

IpcTrain

How to create a rule in Outlook XP or 2003; after 30 days in the inbox send
to a folder?
 
Youy would have to create your own script that decides which messages
exactly satisfy your criteria (30 days in the inbox?) and performs teh
appropriate action.
There is no built-in rule for that.

--
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
 
Dmitry,

What would the script look like. Assume 30 day from receive date or last
review date.
 
Something likethefollowing (off the tp of my head):

strQuery = "[ReceivedTime] > ""10-01-2009"" and [ReceivedTime] <
""10-31-2009"" "
set InboxItems = Application.Session.GetDefaultFolder(olFolderInbox).Items
set Msg = InboxItems.Find(strQuery)
While Not (Msg Is Nothing)
Debug.Print Msg.Subject
set Msg = InboxItems.FindNext
Wend


--
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
 
Thank you.
--
Hope You can help.
Thank You,
IpcTrain


Dmitry Streblechenko said:
Something likethefollowing (off the tp of my head):

strQuery = "[ReceivedTime] > ""10-01-2009"" and [ReceivedTime] <
""10-31-2009"" "
set InboxItems = Application.Session.GetDefaultFolder(olFolderInbox).Items
set Msg = InboxItems.Find(strQuery)
While Not (Msg Is Nothing)
Debug.Print Msg.Subject
set Msg = InboxItems.FindNext
Wend


--
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
IpcTrain said:
Dmitry,

What would the script look like. Assume 30 day from receive date or last
review date.


.
 
How do you place the code in the Rules of outlook? Can the code be generic
so 30 days from date received. This way I do not have to change dates in the
code for each month.


--
Hope You can help.
Thank You,
IpcTrain


Dmitry Streblechenko said:
Something likethefollowing (off the tp of my head):

strQuery = "[ReceivedTime] > ""10-01-2009"" and [ReceivedTime] <
""10-31-2009"" "
set InboxItems = Application.Session.GetDefaultFolder(olFolderInbox).Items
set Msg = InboxItems.Find(strQuery)
While Not (Msg Is Nothing)
Debug.Print Msg.Subject
set Msg = InboxItems.FindNext
Wend


--
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
IpcTrain said:
Dmitry,

What would the script look like. Assume 30 day from receive date or last
review date.


.
 
1. What would trigger that rule? There are no timer events in Outlook,
unless you create your own add-in that uses a timer to run some code at a
predetermined interval. Or you can write your own script (a standalobe VBS
file woudl do) that you could run whenever you want.
2. You would need to use Now or Date intrinsic functions to base the
condition on th current date

--
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
IpcTrain said:
How do you place the code in the Rules of outlook? Can the code be
generic
so 30 days from date received. This way I do not have to change dates in
the
code for each month.


--
Hope You can help.
Thank You,
IpcTrain


Dmitry Streblechenko said:
Something likethefollowing (off the tp of my head):

strQuery = "[ReceivedTime] > ""10-01-2009"" and [ReceivedTime] <
""10-31-2009"" "
set InboxItems =
Application.Session.GetDefaultFolder(olFolderInbox).Items
set Msg = InboxItems.Find(strQuery)
While Not (Msg Is Nothing)
Debug.Print Msg.Subject
set Msg = InboxItems.FindNext
Wend


--
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
IpcTrain said:
Dmitry,

What would the script look like. Assume 30 day from receive date or
last
review date.
--
Hope You can help.
Thank You,
IpcTrain


:

Youy would have to create your own script that decides which messages
exactly satisfy your criteria (30 days in the inbox?) and performs teh
appropriate action.
There is no built-in rule for that.

--
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
How to create a rule in Outlook XP or 2003; after 30 days in the
inbox
send
to a folder?
--
Hope You can help.
Thank You,
IpcTrain


.


.
 
Back
Top