PC Review


Reply
Thread Tools Rate Thread

marking an incoming message when I am not in the 'To' or the 'Cc'

 
 
Russ
Guest
Posts: n/a
 
      7th Aug 2009
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
 
Reply With Quote
 
 
 
 
Ken Slovak - [MVP - Outlook]
Guest
Posts: n/a
 
      7th Aug 2009
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" <(E-Mail Removed)> wrote in message
news:BBC6B3E2-0968-4966-A944-(E-Mail Removed)...
>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


 
Reply With Quote
 
 
 
 
Russ
Guest
Posts: n/a
 
      7th Aug 2009
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" <(E-Mail Removed)> wrote in message
> news:BBC6B3E2-0968-4966-A944-(E-Mail Removed)...
> >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

>
>

 
Reply With Quote
 
Ken Slovak - [MVP - Outlook]
Guest
Posts: n/a
 
      7th Aug 2009
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" <(E-Mail Removed)> wrote in message
news:9A6538AB-4AF7-4A09-925E-(E-Mail Removed)...
> 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


 
Reply With Quote
 
Russ
Guest
Posts: n/a
 
      7th Aug 2009
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" <(E-Mail Removed)> wrote in message
> news:9A6538AB-4AF7-4A09-925E-(E-Mail Removed)...
> > 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

>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
new incoming mail does not go to incoming folding =?Utf-8?B?a3Y=?= Microsoft Outlook Discussion 1 23rd Mar 2007 12:18 PM
Secure email marking how do I fix a secure email marking plugin er =?Utf-8?B?Y2xpZmZvcmQ=?= Microsoft Outlook Discussion 1 23rd Mar 2007 11:41 AM
Outlook on IMAP not marking message as "to be deleted" vide80@gmail.com Microsoft Outlook 2 9th Oct 2006 11:07 AM
Add "Bcc" to rules for marking incoming msgs. Please! =?Utf-8?B?SmFjaw==?= Microsoft Outlook Discussion 1 21st Mar 2006 11:18 AM
Marking a message Unjunked or Not Junk =?Utf-8?B?VkFVVE9VUiAxMTA=?= Microsoft Outlook Discussion 0 12th Nov 2004 11:59 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:46 AM.