![]() |
If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
![]()
I have written a lot of VBA code in excel but not in Outlook.
I would like to mark incoming messages that I recieve with a color if I am not in the 'To' list or the 'Cc' list (which means I got the message as a 'Bcc'). I looked over using rules but they fall just short. -- russ |
#2
|
|||
|
|||
![]()
Do you mean mark it with a colored flag or with a colored format in the
folder view? There's no code access to setting up an autoformat for a view that will color specific items. What version of Outlook? -- Ken Slovak [MVP - Outlook] http://www.slovaktech.com Author: Professional Programming Outlook 2007. Reminder Manager, Extended Reminders, Attachment Options. http://www.slovaktech.com/products.htm "Russ" wrote in message ... I have written a lot of VBA code in excel but not in Outlook. I would like to mark incoming messages that I recieve with a color if I am not in the 'To' list or the 'Cc' list (which means I got the message as a 'Bcc'). I looked over using rules but they fall just short. -- russ |
#3
|
|||
|
|||
![]()
Yes i should have been more explicit. I just want a colored flag next to the
email in the inbox list. I am running outlook 2007. -- russ "Ken Slovak - [MVP - Outlook]" wrote: Do you mean mark it with a colored flag or with a colored format in the folder view? There's no code access to setting up an autoformat for a view that will color specific items. What version of Outlook? -- Ken Slovak [MVP - Outlook] http://www.slovaktech.com Author: Professional Programming Outlook 2007. Reminder Manager, Extended Reminders, Attachment Options. http://www.slovaktech.com/products.htm "Russ" wrote in message ... I have written a lot of VBA code in excel but not in Outlook. I would like to mark incoming messages that I recieve with a color if I am not in the 'To' list or the 'Cc' list (which means I got the message as a 'Bcc'). I looked over using rules but they fall just short. -- russ |
#4
|
|||
|
|||
![]()
Put this code in the ThisOutlookSession class module. It uses the new
flagging for Outlook 2007 and will only run in Outlook 2007. It will run when new items come into the Inbox. Private Sub Application_NewMailEx(ByVal EntryIDCollection As String) Dim IDs() As String Dim oNS As Outlook.NameSpace Dim obj As Object Dim oMail As Outlook.MailItem Dim i As Long Set oNS = Application.GetNamespace("MAPI") IDs = Split(EntryIDCollection, ",") For i = LBound(IDs) To UBound(IDs) Set obj = oNS.GetItemFromID(IDs(i)) If obj.Class = olMail Then Set oMail = obj With oMail If ((InStr(1, .To, "Joe Foobar", vbTextCompare) = 0) _ And (InStr(1, .CC, "Joe Foobar", vbTextCompare) = 0)) Then ' can be any of the new OlMarkInterval enum members .MarkAsTask olMarkNoDate .FlagRequest = "Must be Bcc" .Save End If End With End If Next End Sub -- Ken Slovak [MVP - Outlook] http://www.slovaktech.com Author: Professional Programming Outlook 2007. Reminder Manager, Extended Reminders, Attachment Options. http://www.slovaktech.com/products.htm "Russ" wrote in message ... Yes i should have been more explicit. I just want a colored flag next to the email in the inbox list. I am running outlook 2007. -- russ |
#5
|
|||
|
|||
![]()
Ken,
Many thanks. This is just what I was looking for. Russ -- russ "Ken Slovak - [MVP - Outlook]" wrote: Put this code in the ThisOutlookSession class module. It uses the new flagging for Outlook 2007 and will only run in Outlook 2007. It will run when new items come into the Inbox. Private Sub Application_NewMailEx(ByVal EntryIDCollection As String) Dim IDs() As String Dim oNS As Outlook.NameSpace Dim obj As Object Dim oMail As Outlook.MailItem Dim i As Long Set oNS = Application.GetNamespace("MAPI") IDs = Split(EntryIDCollection, ",") For i = LBound(IDs) To UBound(IDs) Set obj = oNS.GetItemFromID(IDs(i)) If obj.Class = olMail Then Set oMail = obj With oMail If ((InStr(1, .To, "Joe Foobar", vbTextCompare) = 0) _ And (InStr(1, .CC, "Joe Foobar", vbTextCompare) = 0)) Then ' can be any of the new OlMarkInterval enum members .MarkAsTask olMarkNoDate .FlagRequest = "Must be Bcc" .Save End If End With End If Next End Sub -- Ken Slovak [MVP - Outlook] http://www.slovaktech.com Author: Professional Programming Outlook 2007. Reminder Manager, Extended Reminders, Attachment Options. http://www.slovaktech.com/products.htm "Russ" wrote in message ... Yes i should have been more explicit. I just want a colored flag next to the email in the inbox list. I am running outlook 2007. -- russ |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Incoming message content | Gene L.[_2_] | Outlook - General Queries | 0 | October 23rd 08 08:26 PM |
how do I get incoming message to display normally ? | Gary | Outlook - General Queries | 2 | September 15th 08 09:29 PM |
Incoming Message | MEG | Outlook and VBA | 5 | July 16th 08 08:04 PM |
Marking a Message Private in Outlook 2003 | Stars | Outlook - General Queries | 3 | December 22nd 06 09:32 PM |
Outlook on IMAP not marking message as "to be deleted" | [email protected] | Outlook - General Queries | 2 | October 9th 06 11:07 AM |