Mark Calendar Items Read/Unread

With a VBA macro all types of items like appointments, or contacts can be marked read, or unread.

Last modified: 2014/05/23 | Accessed: 30.278  | #105
◀ Previous sample Next sample ▶
Determine the "identity" of your emails. Set with SAM the sender and the folder folder for sent items with the help of rules.

For some item types Outlook doesn't offer a command to mark them as read, or unread, for instance for appointment items. However, with a VBA macro it's possible.

Paste the code to the ThisOutlookSession module. Then select any appointments in your calendar, and press ALT+F8 to run the macro.

tip  How to add macros to Outlook
Public Sub ReadItems()
  SetItemsUnread False
End Sub

Public Sub UnreadItems()
  SetItemsUnread True
End Sub

Private Sub SetItemsUnread(ByVal Unread As Boolean)
  Dim coll As VBA.Collection
  Dim obj As Object
  For Each obj In GetCurrentItems
    obj.Unread = Unread
End Sub

Private Function GetCurrentItems() As VBA.Collection
  Dim coll As VBA.Collection
  Dim Win As Object
  Dim Sel As Outlook.Selection
  Dim obj As Object
  Dim i&
  Set coll = New VBA.Collection
  Set Win = Application.ActiveWindow
  If TypeOf Win Is Outlook.Inspector Then
    coll.add Win.CurrentItem
    Set Sel = Win.Selection
    If Not Sel Is Nothing Then
      For i = 1 To Sel.Count
        coll.add Sel(i)
    End If
  End If
  Set GetCurrentItems = coll
End Function
ReplyAll ReplyAll
ReplyAll alerts you before unintentionally replying all, or if you are a confidential BCC recipient of the e-mail.
email  Send a message