need to automate the subject line with the date sent

HI

Is it possible to set up a routine so that the date is put at the beginning of the subject line on every email before it’s sent or reaches the recipient.

we use outlook 2007 to 2013 via exchange 2007.
LVL 1
total123Asked:
Who is Participating?
 
Rgonzo1971Connect With a Mentor Commented:
Hi,

pls try

This code in the ThisOutlookSession Module after inserting it close Outlook and reopen it
Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
    Item.Subject = Format(Date, "dd.mm.yyyy") & ": " & Item.Subject
End Sub

Open in new window

Regards
0
 
David LeeCommented:
@Rgonzo1971 - I recommend adding an

Item.Save

to your code.
0
 
total123Author Commented:
can I ask what an item save would do ?

this did work on testing, thank you
0
Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

 
David LeeCommented:
Item.Save saves the change to the subject line.
0
 
total123Author Commented:
ok and how would that look on the macro ?
0
 
David LeeConnect With a Mentor Commented:
Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
    Item.Subject = Format(Date, "dd.mm.yyyy") & ": " & Item.Subject
    Item.Save
End Sub

Open in new window

0
 
total123Author Commented:
spot on, thank you
0
 
David LeeCommented:
You're welcome!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.