Help creating macro for conditional formatting settings

Status
Not open for further replies.

Andrew85

New Member
Outlook version
Outlook 2010 32 bit
Email Account
Exchange Server
Hello all,

I am looking to see if it is possible to create a macro in Outlook for conditional formatting. Such as if an email has a specific keyword, or is from this person, it will be displayed in a different color etc. I realize you can do this by going to View > View Settings > Conditional Formatting, however I work in a office of 75+ people and this would be quite tedious to do this for every single person, is there an easy VBA code one can use? Help! I've googled around and have not really seen any for this question, mostly articles that direct people to use the conditional formatting setting included within Outlook. Any suggestions or thoughts? Thanks!

(Note: we use Office 2013 and 2010 32 bit)
 

Andrew85

New Member
Outlook version
Outlook 2010 32 bit
Email Account
Exchange Server

Diane Poremsky

Senior Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
Well, if you just need color, I'd look at categories - they are easier to use. I'm not aware of any other way to push out views.
 

JorgeDario

New Member
Outlook version
Outlook 2010 32 bit
Email Account
POP3
Hola Andrew85, ¿para qué deseas identificar los correos de las 75 personas?
Es cierto, que puedes utilizar las categorías, y crear un macro, que cuando te llegue un correo de un determinado remitente o una palabra específica en el asunto, automáticamente asigne una categoría.
Esto también lo puedes hacer con una regla.

Hi Andrew85, why would you want to identify the 75 people post?
True, you can use the categories, and create a macro that when you reach a mail from a particular sender or a specific word in the subject will automatically assign a category.
This is also you can do with a ruler.
 

Andrew85

New Member
Outlook version
Outlook 2010 32 bit
Email Account
Exchange Server
Thanks everyone for the replies. I think categories is probably the best option then as Jorge and Diane stated. Could someone post a sample macro of what that would look like? For example if specific sender/word in email comes in, it will assign it to a category? Thanks!
 

JorgeDario

New Member
Outlook version
Outlook 2010 32 bit
Email Account
POP3
Amigo, prueba con este código.
Se ejecuta cuando el correo llega, ahora hay un pequeño inconveniente, por la experiencia, si recibes mucho correos al mismo tiempo, le va a tomar tiempo al Outlook procesar el código.
También dependiendo del proceso que hagas se puede optimizar tu trabajo. Haber si te puedo ayudar.

¡Éxitos!

Private Sub Application_NewMailEx(ByVal EntryIDCollection As String)
Dim varEntryIDs
Dim objItem
Dim i As Integer
varEntryIDs = Split(EntryIDCollection, ",")
For i = 0 To UBound(varEntryIDs)
Set objItem = Application.Session.GetItemFromID(varEntryIDs(i))
If objItem.Class = 43 Then
'******SENDER
Select Case Trim(UCase(objItem.SenderName))
Case "DIAZ CARMEN"
objItem.Categories = "DIAZ CARMEN"
objItem.Save
Case "CEVALLOS DAYSE"
objItem.Categories = "CEVALLOS DAYSE"
objItem.Save
Case "ANDREW85"
objItem.Categories = "ANDREW85"
objItem.Save
End Select

'*****SUBJECT
If InStr(1, Trim(UCase(objItem.Subject)), Trim(UCase("PURCHASE")), vbTextCompare) <> 0 Then
objItem.Categories = "PURCHASE"
objItem.Save
End If
End If
Next
End Sub
 

Michael Bauer

Senior Member
Outlook version
Outlook 2010 32 bit
Email Account
Exchange Server
By assigning "Purchase" you erase any other category that could be assigned. Is that intended? If not, use this one:
Code:
objItem.Categories=objItem.Categories & ";Purchase"

BTW: This is an English speaking forum. You English is very good, please use it.
 
Status
Not open for further replies.
Similar threads
Thread starter Title Forum Replies Date
B Need Help Creating Email Based on Subject w Address in Body Outlook VBA and Custom Forms 1
F Creating Meeting Request Custom form and distribute it to domain user HELP!!! Using Outlook 0
F Creating Meeting Request Custom form and distribute it to domain user HELP!!! Using Outlook 0
A Help creating custom Contacts form - what type is 'Email' control? Outlook VBA and Custom Forms 1
A Need help in creating a mass emailing plugin Outlook VBA and Custom Forms 1
witzker Pls help to change the code for inserting date in Ol contact body Outlook VBA and Custom Forms 5
R Disable conversation thread from replying of recipients in the same subject. Please help Using Outlook 0
R seperate read layout to design in outlook 2016..Help!! Outlook VBA and Custom Forms 3
O Help .. got lost ... installing Office like 2016 Using Outlook 5
A Arthur needs help with 2007 Outlook e-mail Using Outlook.com accounts in Outlook 3
R Help Revising VBA macro to delete email over different time span Outlook VBA and Custom Forms 0
Marc2019 Need help please! Cannot Setup my outlook email account on my Mac Outlook 2011 Using Outlook.com accounts in Outlook 2
L Attachment saving and tracking - PLEASE help! Outlook VBA and Custom Forms 5
I Help with dates in task list. Using Outlook 5
C need help setting up outlook first time Using Outlook 1
K To do bar help Using Outlook 8
M Help sending email but removing signature via VBA Outlook VBA and Custom Forms 5
S help with outlook scripting Outlook VBA and Custom Forms 4
J Help Please!!! Outlook 2016 - VBA Macro for replying with attachment in meeting invite Outlook VBA and Custom Forms 9
EmelineGueguen Help to understand the problem of work Using Outlook 1
N Outlook Forms Help Outlook VBA and Custom Forms 2
N Need help syncing contacts to iPhone X Using Outlook 8
S VBA Macro - Run-time error '424': object required - Help Please Outlook VBA and Custom Forms 3
broadbander Needing help with reply/reply all while keeping attachments and adding a new CC recipient. Outlook VBA and Custom Forms 5
J Help! My contacts have disappeared. Using Outlook 5
J HELP- Rule to auto strip prepend from external emails Using Outlook 0
J Help Needed With Multi-Step Login Email Address Using Outlook.com accounts in Outlook 1
G Bcc help - Preventing multiple forwards from a bcc'd distribution group Using Outlook 1
G [Help] Converting array to destination folder path Outlook VBA and Custom Forms 1
K Help.... Office Outlook 2016 Using Outlook 1
S Error using AddressEntry.GetContact - need help Outlook VBA and Custom Forms 2
D Help with code to move mail on receipt to another folder based on time received Outlook VBA and Custom Forms 2
EaglePI Outlook 2010 need help with rules Using Outlook 0
B HELP! Using Outlook 4
Jeff Davis Help fix my Outlook 2013? Using Outlook 28
M Winmail. dat - HELP Using Outlook 2
Diane Poremsky Help! My Contacts are being updated! New Slipstick.com Articles 0
B VBA Help Email that will save as draft and send as attachment Outlook VBA and Custom Forms 3
J Can Anyone Help?? Outlook VBA and Custom Forms 1
C Newbie needs help with Outlook Macro Outlook VBA and Custom Forms 3
B Need Help - Willing to pay Outlook VBA and Custom Forms 10
D help with Item/Inspector close event Outlook VBA and Custom Forms 1
G Looking for help with our Organization Forms Library Outlook VBA and Custom Forms 1
J Need Help with Contacts VBA Outlook VBA and Custom Forms 1
L Outlook 2002: HTML Emails Will Not Print: Please Help Using Outlook 0
H Need help setting up GetFolderPath-Makro with Vodafone IMAP Mail-Account Outlook VBA and Custom Forms 0
A newb outlook macro help Outlook VBA and Custom Forms 1
T Need help with finding/updating task Outlook VBA and Custom Forms 1
X Help with custom form which is very similar to Tasks Outlook VBA and Custom Forms 6
joflo copy contents from outlook to excell - please help. Using Outlook 4

Similar threads

Top