Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Sub FlagByTime()
- Dim aItem As Object
- Dim strTime As String
- Set mail = Application.ActiveExplorer.CurrentFolder
- For Each aItem In mail.Items
- 'Check the message age
- If aItem.ReceivedTime > Date - 30 Then
- strTime = TimeValue(aItem.ReceivedTime)
- 'Check the received time
- If strTime > #6:00:00 PM# Then
- aItem.Categories = "Nighttime"
- aItem.Save
- End If
- End If
- Next aItem
- Set aItem = Nothing
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement