Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 01-11-2019, 10:31 AM
Sacwb3 Sacwb3 is offline Outlook - How do I sort Subject line by a date within the subject line Mac OS X Outlook - How do I sort Subject line by a date within the subject line Office 2016
Novice
Outlook - How do I sort Subject line by a date within the subject line
 
Join Date: Jan 2019
Posts: 1
Sacwb3 is on a distinguished road
Default 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.
Reply With Quote
  #2  
Old 01-11-2019, 10:00 PM
gmayor's Avatar
gmayor gmayor is offline Outlook - How do I sort Subject line by a date within the subject line Windows 10 Outlook - How do I sort Subject line by a date within the subject line Office 2016
Expert
 
Join Date: Aug 2014
Posts: 4,101
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
Reply

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 - How do I sort Subject line by a date within the subject line Outlook - Add text to subject line when sending a reply email rparker85 Outlook 3 12-12-2011 10:26 AM
Outlook - How do I sort Subject line by a date within the subject line Outlook 2010 Web Access Subject line length Emerogork Outlook 4 06-08-2011 05:50 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 04:28 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft