chrisk2305
Member
- Outlook version
- Outlook 2016 64 bit
- Email Account
- Office 365 Exchange
Hi Guys,
My Goal is create a Outlook Macro that adds the date into the subject line of every email for the following occasions:
Every email that arrives
Every new Email I create
Every Email I answer or forward
The Subject should look like: "2016-05-11 This is a test"
My first try was to create a script rule for incoming emails. The script contains the following code:
The code was actually copied from this side. But actually nothing happens and I have no idea how to debug. Can you guys help a noob?
Thanks in advance!
Christian
My Goal is create a Outlook Macro that adds the date into the subject line of every email for the following occasions:
Every email that arrives
Every new Email I create
Every Email I answer or forward
The Subject should look like: "2016-05-11 This is a test"
My first try was to create a script rule for incoming emails. The script contains the following code:
Code:
Sub ChangeSubject()
Dim myolApp As Outlook.Application
Dim aItem As Object
Set myolApp = CreateObject("Outlook.Application")
Set mail = myolApp.ActiveExplorer.CurrentFolder
For Each aItem In mail.Items
aItem.Subject = "Date" & aItem.Subject
aItem.Save
Next aItem
End Sub
The code was actually copied from this side. But actually nothing happens and I have no idea how to debug. Can you guys help a noob?
Thanks in advance!
Christian