Outlook 2003 - Email row highlighting

Posted on 2004-10-06
Last Modified: 2012-08-14

Not sure if this is possible but I'd thought I'd ask.  I receive emails from 2 different accounts all collected into the same pot.  If I look at the Internet headers I can clearly see in the To: value which of my email accounts the message has been sent to.  Is there any formatting facility to highlight the row in a different colour for each To: account?

Question by:elliptical
  • 3
  • 3

Expert Comment

ID: 12236525

Well I guess there could be a coding solution, but you don't really need one if I understand what you want to do correctly. You want to be able to tell the difference between mail that's sent to one box vs the other one more easily right?

Try this:
1. Open Outlook and go to your inbox
2. Click on View in the menu, go to "Arrange By", and select "To"
3. Click on View and again go to "Arrange By", now select "Show in Groups"

You should have a collapsable folder now for every TO field that each contains the mails sent to your different folders.

Any reason you can't use this?

Author Comment

ID: 12237383
Thanks TM,

I know what your getting at but I want to keep the messages in date received order as I have it.  I know I can sub sort but it looks messy.  I'll have to code something I guess.

Thanks for the input.


Expert Comment

ID: 12237630

Well, you can't really do anything in programming that you can't also do in the GUI. So you'd be able to mark messages from one address with a flag for instance, but you wouldn't be able to highlight the entire row, since you can't do that in the GUI either. I don't understand why you say that sorting it into groups would be messy, but okay.

How is your Outlook set up if I might ask? What I mean is, do the messages stay on a remote server or do they get downloaded to your local harddisk and then get erased from the server? The solution would be different depending on the answer. And would flagging the message with say a purple or whatever coloured flag be sufficient?

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.


Author Comment

ID: 12237697
It's IMAP and yes a coloured flag would be fine.  My mailserver had worldclient a webmail interface which used to highlight in different colours depending on the "To" value.  Unfortunately they dropped that out and said they would put it back in at some later point.


Accepted Solution

thunder_moose earned 350 total points
ID: 12238521
Hi there,

In order for this to work, you'll have to press Alt+F11 in Outlook, then paste this code there:

Sub FlagMessages()

Dim olApp As Outlook.Application
Dim olNS As Outlook.NameSpace
Dim olFolder As Outlook.MAPIFolder
Dim olMsg As Outlook.MailItem

Set olApp = New Outlook.Application
Set olNS = olApp.GetNamespace("MAPI")
Set olFolder = olNS.GetSharedDefaultFolder(olApp.Session.CurrentUser, olFolderInbox)

For Each olMsg In olFolder.Items
    MsgBox olMsg.To
    If olMsg.To = "TheAddress" Then
       olMsg.FlagStatus = olFlagMarked
       olMsg.FlagIcon = olGreenFlagIcon
    End If
End Sub

This code will go through your mailbox on the server and look for TheAddress, where TheAddress is the To address exactly as you see it in Outlook. It will flag the message green, but you can change it to whatever you want of course. You can add it as a macro button in Outlook by customizing your toolbar (right click on the right hand side, there's a little arrow, and choose customize, then click macros and drag the sub onto the toolbar. Right click it and rename it).

There's a problem with this of course. Each time you get new mail youl have to run the macro again so it flags it. You'll also need to manually refresh it to see the flag, select then deselect your mailbox.

Well I'm sorry but I'm going home now. I'll check again tomorrow for any comments.



Author Comment

ID: 12247183
Hi TM,

Thanks for the input.  I've managed the same job but using the "outlook rules" so it applies it to mail as it arrives.  Your code though inspired me to look into it so I'll accept your answer!  

Thanks again.

Best regards

Expert Comment

ID: 12291727
Yes, just use the rules wizard, this is the easy way.  I can go into detail if you need.


Featured Post

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
merge adobe pdf files 14 103
URL to download SonicWALL Net Extender for Mac application 4 48
IT Asset Management 5 69
Ransomware attacks 5 87
Storage devices are generally used to save the data or sometime transfer the data from one computer system to another system. However, sometimes user accidentally erased their important data from the Storage devices. Users have to know how data reco…
This guide will walk you through the essential considerations and tech stack for building scalable websites. Know how to grow your business the smart way!
This video shows how use content aware, what it’s used for, and when to use it over other tools.
This video demonstrates how to use each tool, their shortcuts, where and when to use them, and how to use the keyboard to improve workflow.

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now