About Me ·
At GROSSWEBER we practice what we preach. We offer trainings for modern software technologies like Behavior Driven Development, Clean Code and Git. Our staff is fluent in a variety of languages, including English.
Recently my mailing lists subscriptions grew to an extend not seen before, largely due to my grown interest in ALT.NET and open source projects. Having an eye on the dev or user mailing lists is often very valuable to stay on top of recent developments, identify best practices and to post or answer the occasional question.
However, that doesn't come without drawbacks. One increasing hassle is to keep up with the constant flow of information such that I see myself forced to reset once in while. After getting back from a 3-day vacation this summer I had 200+ unread feed items and uncounted unread mailing lists messages. I do not claim to read everything that lands in my inbox(es) so a quick "mark all as read" is a very relieving act. FeedDemon, my feed reader, even has a panic button to support this discomforting situation.
Unfortunately Outlook does not support marking all items read in a certain folder and all of its subfolders. On the other hand, there is this ancient VBA language that you can use to program Outlook…
Dim resultFolder As folder
Dim folder As folder
Dim item As MailItem
Set resultFolder = GetFolder("path\to\your\mailing\lists\root\folder")
For Each folder In resultFolder.folders
For Each item In folder.Items.Restrict("[unread] = true")
item.UnRead = False
Set resultFolder = Nothing
Set folder = Nothing
Set item = Nothing
Function GetFolder(strFolderPath As String) As MAPIFolder
' strFolderPath needs to be something like
' "Public Folders\All Public Folders\Company\Sales" or
' "Personal Folders\Inbox\My Folder"
Dim colFolders As Outlook.folders
Dim objFolder As Outlook.MAPIFolder
Dim arrFolders() As String
Dim i As Long
On Error Resume Next
strFolderPath = Replace(strFolderPath, "/", "\")
arrFolders() = Split(strFolderPath, "\")
Set objFolder = Application.GetNamespace("MAPI").folders.item(arrFolders(0))
If Not objFolder Is Nothing Then
For i = 1 To UBound(arrFolders)
Set colFolders = objFolder.folders
Set objFolder = Nothing
Set objFolder = colFolders.item(arrFolders(i))
If objFolder Is Nothing Then
Set GetFolder = objFolder
Set colFolders = Nothing
Thanks to Lars Keller for the hint to filter unread items with Restrict()!
a@href@title, blockquote@cite, em, strike, strong, sub, sup, u
Page rendered at Monday, September 26, 2016 8:58:24 PM (W. Europe Daylight Time, UTC+02:00)
newtelligence dasBlog 2.3.257.0
© Copyright 2016, admin
The opinions expressed herein are my own personal opinions and do not represent
my employer's view in any way.