Guest User

Untitled

a guest
Jan 23rd, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. Sub ChangeSubjectSelection()
  2.  
  3. Dim selectionIndex As Long
  4. Dim itm As Object
  5.  
  6. For selectionIndex = 1 To ActiveExplorer.Selection.Count
  7.  
  8. Set itm = ActiveExplorer.Selection(selectionIndex)
  9.  
  10. If TypeOf itm Is MailItem Then
  11. itm.Subject = "add value here-" & itm.Subject
  12. itm.Save
  13. End If
  14. Next
  15.  
  16. End Sub
  17.  
  18. Dim Item As Outlook.MailItem
  19. Dim oInspector As Inspector
  20. Set oInspector = Application.ActiveInspector
  21. Set Item = oInspector.CurrentItem
  22.  
  23. If InStr(Item.Subject, "New Value -") > 0 Then
  24.  
  25. Else
  26.  
  27. Item.Subject = "New Value -" & Item.Subject
  28.  
  29. End If
Add Comment
Please, Sign In to add comment