How to mark a previously opened email as unread via vba in Outlook2007 on Exchange

  • Thread starter Thread starter Neil.D
  • Start date Start date
N

Neil.D

I have a very precise requirement in Outlook and thank everyone in
advance for any help.

I access my exchange mailbox though multiple devices: the iPhone, the
iPad and Outlook 2007.

The iPhone and iPad are usually monitored on the move when I'm outside
the office. Any urgent emails are responded immediately but given that
the method of entering the data is rather slow, most of my replies are
short to action any tasks.

I usually get back into the office, switch on the laptop and go
through the mails again to reply to them properly as required. In the
earlier scenario with a POP account, the arriving mails were marked in
bold when they were downloaded to the laptop, even if they were read
on the iPhone/iPad. Based on that, I was used to a system where I went
though all the new mails and replied to them as required.

With Exchange, any mail seen on the iPhone/iPad is marked as read and
is not available in bold. So sometimes I'm overlooking mails that need
to be actioned. Due to the sheer volume of mails I receive, it would
be great to have a VBA script that could mark all mails coming on my
laptop (regardless of whether they are previously read or not) as
unread.

Any help would be highly appreciated.
 
The mails are marked in Exchange as read, there's no way to tell when you
turn on your laptop what marked something as read. Do you want all items in
your Inbox marked as read every time you turn on the machine, no matter how
old they are or whether they were marked as read by you on the laptop or by
reading them on another device.

A simple VBA script that would mark everything unread can be put into your
ThisOutlookSession class module in the VBA project:

Private Sub Application_Startup()
Dim oItems As Outlook.Items
Dim obj As Object

Set oItems = Application.Session.GetDefaultFolder(olFolderInbox).Items
For Each obj In oItems
obj.Unread = True
obj.Save
Next

Set obj = Nothing
Set oItems = Nothing
End Sub

That will mark every item in your Inbox as unread every time you start up
Outlook, but I don't really think that's what you want.
 
I have to admit, I am quite new to VBA, but I would like to use the same script to run in a different folder in Outlook 2016 (or 2013). How could I modify Ken's script to either ask me for a folder, or to run against the folder Archive which is at the same level as Inbox in my folder structure.
Appreciate this is a post from a while ago, but would welcome any help.
 
Back
Top