Hello,
you can create a VBA script that handles this.
In Outlook press ALT+F11 and write your code as in the following example:
<pre>
Sub CustomMailMessageRule(Item As Outlook.MailItem)
' Must always be named as follows otherwise
' you cannot use it as an Outlook rule
DeleteOlder
End Sub
Sub DeleteOlder()
On Error GoTo DeleteOlder_err
Dim ns As NameSpace
Dim Inbox As MAPIFolder
Dim Item As Object
Dim Atmt As Attachment
Dim FileName As String
Dim i As Integer
Dim SentDate As Date
Set ns = GetNamespace("MAPI")
Set Inbox = ns.GetDefaultFolder(olFolderInbox)
For Each Item In Inbox.Items
' Work with the date difference of the "Item.SentOn" data and you have what you need
If DateDiff("d",Item.SentOn,Now) > 30 Then
....
End if
Next Item
DeleteOlder_exit:
Set Atmt = Nothing
Set Item = Nothing
Set ns = Nothing
Exit Sub
DeleteOlder:
Resume DeleteOlder_exit
End Sub
</pre>
Once you've tested this you can simply create an Outlook rule that will be run according to your needs, I hope this helps.
Regards,
Alessandro
Last Wiki Answer Submitted: May 14, 2008 2:28 pm by alessandro.panzetta9,695 pts.
If you live outside the United States, by submitting your email address you consent to having your personal data transferred to and processed in the United States.