alienblk1980
09-12-2017, 01:00 PM
Hi All,
Trying to establish whether is a possible set expiry date(30 days) for incoming emails then redirect that email to different recipients/groups.
I want to run that as outlook rule, triggered by certain keywords and then start a script. I have seen outlook scripts for setting expiry date(see below) but wondering whether someone could help me?
Thank you
Public WithEvents olItems As Items
Private Sub Application_Startup()
Set olItems = Application.Session.GetDefaultFolder(olFolderInbox).Items
End Sub
Private Sub olItems_ItemAdd(ByVal Item As Object)
Dim strMsg As String
Dim nRes As Integer
If Item.ExpiryTime = #1/1/4501# Then
Item.ExpiryTime = DateAdd("m", 1, Item.ReceivedTime)
End If
Item.Save
End Sub
Trying to establish whether is a possible set expiry date(30 days) for incoming emails then redirect that email to different recipients/groups.
I want to run that as outlook rule, triggered by certain keywords and then start a script. I have seen outlook scripts for setting expiry date(see below) but wondering whether someone could help me?
Thank you
Public WithEvents olItems As Items
Private Sub Application_Startup()
Set olItems = Application.Session.GetDefaultFolder(olFolderInbox).Items
End Sub
Private Sub olItems_ItemAdd(ByVal Item As Object)
Dim strMsg As String
Dim nRes As Integer
If Item.ExpiryTime = #1/1/4501# Then
Item.ExpiryTime = DateAdd("m", 1, Item.ReceivedTime)
End If
Item.Save
End Sub