View Single Post
 
Old 08-14-2023, 02:04 AM
TylerDurden TylerDurden is offline Windows 10 Office 2021
Novice
 
Join Date: Aug 2023
Posts: 1
TylerDurden is on a distinguished road
Default Help...Trying to use VBA in Outlook to add "to/from" recipient initials to subject

Hi all,

I currently have a script which on my selecting of mail items, adds the current date in YYYYMMDD format in addition to the existing subject line.

I'd now like to add the "to/from" recipient initials of the selected email in addition to what I have already scripted.

For example, I'd like to select an email(s), run vba and then have the email format change to "YYYYDDMM DH to BD existing subject line"

Current script is as follows:

Sub selectedMailItemsSubjectWithDate ()
Dim Mitem As MailItem
On Error GoTo ExitPos
For Each MItem in ActiveExplorer.Selection
MItem.Subject = Format (MItem.ReceivedTime,
"YYYYMMDD") & " " & MItem.Subject
MItem.Save
Next
ExitPos:
End Sub



Any help would be much appreciated!

T
Reply With Quote