Advertisement
Guest User

Untitled

a guest
Jul 30th, 2014
214
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. Sub FlagByTime()
  2. Dim aItem As Object
  3. Dim strTime As String
  4.  
  5. Set mail = Application.ActiveExplorer.CurrentFolder
  6. For Each aItem In mail.Items
  7.  
  8. 'Check the message age
  9. If aItem.ReceivedTime > Date - 30 Then
  10.  
  11. strTime = TimeValue(aItem.ReceivedTime)
  12.  
  13. 'Check the received time
  14. If strTime > #6:00:00 PM# Then
  15. aItem.Categories = "Nighttime"
  16. aItem.Save
  17. End If
  18.  
  19. End If
  20.  
  21. Next aItem
  22.  
  23. Set aItem = Nothing
  24. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement