Created
July 17, 2013 07:33
-
-
Save ijd65/6018458 to your computer and use it in GitHub Desktop.
Renames the subject of the selected Outlook email
This file contains hidden or 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