View Single Post
 
Old 01-11-2019, 10:00 PM
gmayor's Avatar
gmayor gmayor is offline Windows 10 Office 2016
Expert
 
Join Date: Aug 2014
Posts: 4,106
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

The following script (MoveDate) if run from a rule will add the date from the end of the subject to the start of the subject. Test it with a selected message and the test macro.



Code:
Option Explicit

Sub Test()
Dim olMsg As MailItem
    On Error Resume Next
    Set olMsg = ActiveExplorer.Selection.Item(1)
    MoveDate olMsg
lbl_Exit:
    Exit Sub
End Sub

Sub MoveDate(oItem As MailItem)
Dim sText As String
    If oItem.Subject Like "Site * Alert:*" Then
        sText = Right(oItem.Subject, 10)
        If IsDate(sText) = True Then
            oItem.Subject = sText & Chr(32) & oItem.Subject
            oItem.Save
        End If
    End If
lbl_Exit:
    Exit Sub
End Sub
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote