VBOffice

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: 31.049  | #105
◀ Previous sample Next sample ▶
ReplyAll ReplyAll
ReplyAll alerts you before unintentionally replying all, or if you are a confidential BCC recipient of the e-mail.

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
    obj.Save
  Next
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
  Else
    Set Sel = Win.Selection
    If Not Sel Is Nothing Then
      For i = 1 To Sel.Count
        coll.add Sel(i)
      Next
    End If
  End If
  Set GetCurrentItems = coll
End Function
Reporter Reporter
VBOffice Reporter is an easy to use tool for data analysis and reporting in Outlook. A single click, for instance, allows you to see the number of hours planned for meetings the next month.
email  Send a message