Last active
August 29, 2020 10:27
-
-
Save logic2design/38ab8c49bc1a54a1648e4cb76db25fd3 to your computer and use it in GitHub Desktop.
Renames the subject of the selected Outlook email https://gist.github.com/38ab8c49bc1a54a1648e4cb76db25fd3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Private Sub Rename() | |
'Dim olTask As Outlook.TaskItem | |
'Using object so all items can be processed | |
Dim olitem As Object | |
Dim olExp As Outlook.Explorer | |
Dim fldCurrent As Outlook.MAPIFolder | |
Dim olApp As Outlook.Application | |
Set olApp = Outlook.CreateObject("Outlook.Application") | |
Set olExp = olApp.ActiveExplorer | |
Set fldCurrent = olExp.CurrentFolder | |
Dim cntSelection As Integer | |
cntSelection = olExp.Selection.Count | |
For i = 1 To cntSelection | |
Set olitem = olExp.Selection.Item(i) | |
' Mark as unread | |
olitem.UnRead = False | |
'olitem.Sensitivity = olNormal | |
olitem.Save | |
newName = InputBox("Enter the revised subject:", "New Subject", olitem.Subject) | |
' OL07 uses the property .TaskSubject | |
olitem.Subject = newName | |
olitem.Save | |
Next | |
End Sub |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment