#1
|
|||
|
|||
Outlook - How do I sort Subject line by a date within the subject line
Office 365 - Outlook
We have a project management system that sends us an email when a task has been completed. in the subject line there is the construction site number and a specific milestone date after the site number. We wish to sort by the date within the subject line even though the date is not appearing at the beginning of the subject line. Example subject line; Site OH0550004B Alert: Rev 1 Redline Construction Drawings - Milestone 6 Completion Forecast: 2019/04/15 Notice that the milestone date of completion is at the end of the subject line. This is what we want to be able to sort by. Is there a rule that I can use for this? We have not been successful getting the project management software to move the date to the front of the subject line. We have tried. Any assistance is greatly appreciated. |
#2
|
||||
|
||||
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 |
Thread Tools | |
Display Modes | |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Can't see full text of From and Subject line in Outlook 2013 | poptranslation | Outlook | 0 | 12-15-2016 04:34 AM |
Change subject to include date and time in subject | officechris | Outlook | 1 | 05-01-2015 09:58 PM |
Auto Subject Line | hollwall | Outlook | 0 | 04-19-2012 08:49 AM |
Outlook - Add text to subject line when sending a reply email | rparker85 | Outlook | 3 | 12-12-2011 10:26 AM |
Outlook 2010 Web Access Subject line length | Emerogork | Outlook | 4 | 06-08-2011 05:50 PM |